View Full Version : VBA code (macros) understanding
anabelle
07-11-2019, 05:29 AM
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?
Kenneth Hobs
07-11-2019, 07:29 AM
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.
Jan Karel Pieterse
07-11-2019, 08:14 AM
What error precisely? And what has been assigned to units?
Paul_Hossler
07-12-2019, 07:05 AM
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
For i = 1 To UBound(units, 1)
in the For loop (need to explicitly specify the dimension for multi-dimensional array)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.