Notifications
Clear all

Erro 1004

2 Posts
2 Usuários
0 Reactions
669 Visualizações
(@selmont)
Posts: 1
New Member
Topic starter
 

Boa Tarde,

Sou novo no fórum, bem como, no VBA.

Estou sofrendo com o erro 1004 e não sei o que está errado na minha linha de código.

Conto com a ajuda dos mais experientes.

Att.

Diego

Application.ScreenUpdating = False
    Range("J6").Select
    ActiveCell.FormulaR1C1 = "=R[5]C[-8]"
    Range("K6").Select
    ActiveCell.FormulaR1C1 = "=R[6]C[-9]"
    Range("L6").Select
    ActiveCell.FormulaR1C1 = "=R[6]C[-4]"
    Range("M6").Select
    ActiveCell.FormulaR1C1 = "=R[7]C[-11]"
    Range("N6").Select
    ActiveCell.FormulaR1C1 = "=R[7]C[-9]"
    Range("O6").Select
    ActiveCell.FormulaR1C1 = "=R[7]C[-7]"
    Range("P6").Select
    ActiveCell.FormulaR1C1 = "=R[8]C[-14]"
    Range("Q6").Select
    ActiveCell.FormulaR1C1 = "=R[9]C[-15]"
    Range("R6").Select
    ActiveCell.FormulaR1C1 = "=R[9]C[-12]"
    Range("R7").Select
    Range("S6").Select
    ActiveCell.FormulaR1C1 = "=R[9]C[-11]"
    Range("S7").Select
    Range("T6").Select
    ActiveCell.FormulaR1C1 = "=R[10]C[-18]"
    Range("T7").Select
    Range("U6").Select
    ActiveCell.FormulaR1C1 = "=R[10]C[-16]"
    Range("V6").Select
    ActiveCell.FormulaR1C1 = "=R[10]C[-14]"
    Range("V7").Select
    Range("W6").Select
    ActiveCell.FormulaR1C1 = "=R[11]C[-21]"
    Range("X6").Select
    ActiveCell.FormulaR1C1 = "=R[11]C[-18]"
    Range("X7").Select
    Range("Y6").Select
    ActiveCell.FormulaR1C1 = "=R[11]C[-17]"
    Range("Y7").Select
    Range("Z6").Select
    ActiveCell.FormulaR1C1 = "=R[12]C[-24]"
    Range("AA6").Select
    ActiveCell.FormulaR1C1 = "=R[12]C[-22]"
    Range("AA7").Select
    Range("AB6").Select
    ActiveCell.FormulaR1C1 = "=R[12]C[-20]"
    Range("AB7").Select
    Range("AC6").Select
    ActiveCell.FormulaR1C1 = "=R[15]C[-27]"
    Range("AC7").Select
    Range("AD6").Select
    ActiveCell.FormulaR1C1 = "=R[15]C[-25]"
    Range("AD7").Select
    Range("AE6").Select
    ActiveCell.FormulaR1C1 = "=R[15]C[-22]"
    Range("AE7").Select
    Range("AF6").Select
    ActiveCell.FormulaR1C1 = "=R[16]C[-30]"
    Range("AF7").Select
    Range("AG6").Select
    ActiveCell.FormulaR1C1 = "=R[16]C[-29]"
    Range("AG7").Select
    Range("AH6").Select
    ActiveCell.FormulaR1C1 = "=R[16]C[-27]"
    Range("AH7").Select
    Range("AI6").Select
    ActiveCell.FormulaR1C1 = "=R[16]C[-26]"
    Range("AI7").Select
    Range("AJ6").Select
    ActiveCell.FormulaR1C1 = "=R[17]C[-34]"
    Range("AJ7").Select
    Range("AK6").Select
    ActiveCell.FormulaR1C1 = "=R[17]C[-32]"
    Range("AK7").Select
    Range("AL6").Select
    ActiveCell.FormulaR1C1 = "=R[17]C[-30]"
    Range("AL7").Select
    Range("AM6").Select
    ActiveCell.FormulaR1C1 = "=R[18]C[-37]"
    Range("AM7").Select
    Range("AN6").Select
    ActiveCell.FormulaR1C1 = "=R[18]C[-36]"
    Range("AN7").Select
    Range("AO6").Select
    ActiveCell.FormulaR1C1 = "=R[18]C[-35]"
    Range("AO7").Select
    Range("AP6").Select
    ActiveCell.FormulaR1C1 = "=R[19]C[-40]"
    Range("AP7").Select
    Range("AQ6").Select
    ActiveCell.FormulaR1C1 = "=R[20]C[-35]"
    Range("AQ7").Select
    Range("J6").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Application.CutCopyMode = False
    Selection.Cut
    Selection.End(xlDown).Select
    Selection.End(xlDown).Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(1, 0).Select
    ActiveSheet.Paste
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("I6").Select
    Range("A1:I27").Select
    Selection.Copy
    Workbooks.Add
    ActiveSheet.Paste
    Cells.Select
    Cells.EntireColumn.AutoFit
    Columns("J:J").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.EntireColumn.Hidden = True
    ActiveWindow.SmallScroll Down:=12
    Rows("27:27").Select
    Range("B27").Activate
    Range(Selection, Selection.End(xlDown)).Select
    Selection.EntireRow.Hidden = True
    ActiveWindow.SmallScroll Down:=-33
    ActiveWindow.SmallScroll ToRight:=-1
    ActiveSheet.Shapes.Range(Array("Rounded Rectangle 2")).Select
    Application.CutCopyMode = False
    Selection.Cut
    ActiveSheet.Shapes.Range(Array("Rounded Rectangle 3")).Select
    Selection.ShapeRange.IncrementTop 9
    Selection.Cut
    Dim fDlg    As FileDialog
 
    Set fDlg = Application.FileDialog(FileDialogType:=msoFileDialogSaveAs)
    fDlg.InitialFileName = ActiveWorkbook.Name
 
    fDlg.Show
End Sub
 
Postado : 03/01/2017 1:22 pm
Fernando Fernandes
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Boa noite Diego

Seja bem-vindo ao fórum!

Como você é novato no fórum, para facilitar a tua participação, sugiro tomar conhecimento do conteúdo dos links abaixo:
viewtopic.php?f=7&t=203
viewtopic.php?f=7&t=7903
viewtopic.php?f=7&t=3841
viewtopic.php?f=7&t=16757
viewtopic.php?f=7&t=12600
viewtopic.php?f=7&t=3371

[]s

Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel

 
Postado : 03/01/2017 3:33 pm