我想在代碼中使用工作表的名稱來選擇一個範圍。我有37張,我不想寫代碼37次。以下代碼返回錯誤1004
Sub relatorio()
Dim ws As Worksheet, GI As Integer, J As Integer
J = 0
For Each ws In ActiveWorkbook.Worksheets
J = J + 1
If ws.Name = "Brasil" Then
i = (8 * 0) + 4 And GI = (13 * 0) + 271
End If
If ws.Name <> "Dados" Then
'the error occur in the next line.
Worksheets(ws.Name).Shapes.Range(Array("TRI")).Select
Selection.Formula = "=Dados!a2"
Selection.ShapeRange.TextFrame2.TextRange.Font.Name = "Calibri"
Selection.ShapeRange.TextFrame2.TextRange.Font.Size = 9
End If
Next
End Sub
我不知道該怎麼辦
是的形狀被命名爲TRI –