Hello,
Whenever I want to run macros I get the following Debug error:
For i = 1 To UBound(units)
table(lRow, units(i, 2)) = Range(units(i, 1))
Can someone explain what it means?
Hello,
Whenever I want to run macros I get the following Debug error:
For i = 1 To UBound(units)
table(lRow, units(i, 2)) = Range(units(i, 1))
Can someone explain what it means?
Welcome to the forum!
There is really no way to know without knowing what your variable values are. You can use Debug.Print to put run results in VBE Immediate window.
What error precisely? And what has been assigned to units?
I'm guessing that "units" is a 2 dimensional array based on Range(units(I,1))
For i = 1 To UBound(units) table(lRow, units(i, 2)) = Range(units(i, 1))
If that's true, then you need something like
in the For loop (need to explicitly specify the dimension for multi-dimensional array)For i = 1 To UBound(units, 1)
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3