jardenp
Active Member
- Joined
- May 12, 2009
- Messages
- 373
- Office Version
- 2019
- 2016
- 2013
- 2011
- 2010
- Platform
- Windows
I am not well versed in loops, so please bear with me.
In A1:A20 there is a list of PO numbers of variable count, i.e., there could be one PO, twenty POs, or any number inbetween.
I have 20 variables declared. PO1, PO2, ... PO20. I also have POCount declared and assigned the count of populated cells in A1:A20 (using a simple xlEnd function). All are Variants, though I suppose POCount could be Integer if needed.
There should never be a blank cell with a non-blank cell below it.
I would like a VBA loop to start in A1 and then loop through to A&POCount and in each cell assign the cell value to the variable PO&row number. So value from A4 is assigned to PO4, A7 to PO7, etc.
I can't figure out how to construct a variable name in the loop and use it (basically how to get it to recognize "PO" & i as a single variable name.
Thanks,
Josh in IN
In A1:A20 there is a list of PO numbers of variable count, i.e., there could be one PO, twenty POs, or any number inbetween.
I have 20 variables declared. PO1, PO2, ... PO20. I also have POCount declared and assigned the count of populated cells in A1:A20 (using a simple xlEnd function). All are Variants, though I suppose POCount could be Integer if needed.
There should never be a blank cell with a non-blank cell below it.
I would like a VBA loop to start in A1 and then loop through to A&POCount and in each cell assign the cell value to the variable PO&row number. So value from A4 is assigned to PO4, A7 to PO7, etc.
I can't figure out how to construct a variable name in the loop and use it (basically how to get it to recognize "PO" & i as a single variable name.
Thanks,
Josh in IN