VBA, assigned to the array, array showed a null value
Time:03-03
Topic request post, want to ask me where the program logic is wrong in Two problems Always say after 1 assigned area to the array subscript crossing the line array values, may be the array is empty, but in fact the regional assignment not to empty 2 then said range on the worksheet failure
We had an afternoon also don't know, Worksheets (workbook name). The range (cells (), cells ()) This expression is wrong? If can't refer to the how to fix it? Is there free will? Few question mark for the first time, thank you very much willing to answer students
CodePudding user response:
The Sub (d)
Dim j, As Long As Long, I name As String, wname As Worksheet, name1 As String, RNG As Range, name2 As Range, a () J=2 Worksheets (" attendance statistics "). Activate For j=2 To 22
Name=Cells (1, j). The Value
The Set wname=Worksheets (name)
The Set RNG=wname. Range (Cells (3, 2), Cells (3, 2). The End (xlDown)) A=RNG I=1
For I=LBound (a) To UBound (a)
Set name2=Worksheets (" attendance statistics "). The Cells. The Find (name1)
If Not name2 Is Nothing Then Name2. Offset (0, j - 1) Value="https://bbs.csdn.net/topics/yes" End the If Next I Next j This is the program
CodePudding user response:
Then this formula, the end (xldown) shows - 4121, is this why
CodePudding user response:
Excel to run such a big table is not a problem, still have even if I understand into set wname=worksheets (name) this code is what you want to refer to one or more tables, and the name in brackets should be one or more table the table name, so there will be a function object error prompt, I also checked the code, how to use the specific is not running, hope to help you,