我想讓我的程序運行2個工作簿和3個工作表。爲我驗證一些數字。編譯錯誤:無效的限定符
Sub Validate_Old_Data()
Dim DBLbrow As Double
Dim DBLAbrow As Double
Dim DBLBbrow As Double
Dim STRname As String
Dim INTcc As Integer
Dim CopyRange As Range
DBLbrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
Do While BDLbrow > 5
STRname = Range("B" & DBLbrow).Value
INTcc = Range("C" & DBLbrow).Value
Workbooks("Z:\Centralized Charges\Centralized Charges 2015\Forecast and Actuals\P3\Headcount Templates\P3 Centralized Charges Headcount Tracker (vs. 2015 Budget).xlsx").Activate
Worksheets(INTcc).Activate
DBLAbrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
Do While DBLAbrow > 8
If Range("B" & DBLAbrow).Value = STRname Then
CopyRange = Range(DBLAbrow).Row.Copy
Workbooks("Z:\Centralized Charges\Centralized Charges 2015\Forecast and Actuals\P3\Headcount Templates\Charges Headcount Tracker (vs. 2015 Budget).xlsm").activatae
Worksheets(INTcc).activatae
DBLBbrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
If Range("B" & DBLBbrow).Value = STRname Then
Range(DBLbrow).Value = CopyRange
Else
DBLBbrow = DBLBbrow - 1
End If
Loop
Else
DBLAbrow = DBLAbrow - 1
End If
Loop
BDLbrow = BDLbrow - 1
End Sub
但我正在一個無效預選賽錯誤,有人可以解釋爲什麼?
你可以多說一點你想用這段代碼做什麼嗎?也許縮小到一個更小的塊。 –
哪條線停在? – Sam
它停在第一行......我從來沒有遇到過這個問題。此代碼的目的是循環遍歷列表,在電子表格B中找到相應的值,然後將所有數據返回給電子表格A。 –