-2
我在循環FOR中有錯誤。我不明白爲什麼。我的目的是激活「自動計算」選項,然後刪除所有舊行並最終添加新行。循環中的錯誤
Sub refresh()
'
' refresh Macro
'
' Touche de raccourci du clavier: Ctrl+y
'
Dim LastRow As Integer, i As Integer
Application.Calculation = xlAutomatic
Range("A6:AP1000").Select
Application.DisplayAlerts = False
Selection.Delete
Application.DisplayAlerts = True
Range("A6:AP1000").Select
Selection.ClearContents
Sheets("PTR").Range(「A」 & Rows.Count).Select
For i = 2 To Sheets("PTR").Range(「A」 & Rows.Count).End(xlUp).Row
If Cells(i, 1) = "X" Then
Range(Cells(i, 1), Cells(i, 20)).Select
Selection.Copy
Sheets("Analyse de risque").Range("B" & Rows.Count).PasteSpecial xlPasteValuesAndNumberFormats
Application.CutCopyMode = False
End If
Next i
End Sub
這個錯誤是......?哦,並且不要使用微軟的詞來編輯你的代碼。 '「A」'不是有效的引號... –