sous2817
Well-known Member
- Joined
- Feb 22, 2008
- Messages
- 2,276
Hello everyone,
Currently I'm building up an array by looping through a set of columns with code like:
That all works fine, but what I'm hoping to do is reorder the array index from {1,2,3,4,etc, etc, etc} to something like: {1,x,2,3,etc,etc,etc} or {1,x,2,4,etc,etc,etc}
The x is defined earlier in the code, it's an integer that defines what column they want to apply some color to.
Index 1 is the description (in this case country name) and will always be first. The remaining parts of the array are various values that the user assigns to the country. I started with the assumption that they'd always put the "use this value to apply colors to" in column B, but that's not always going to be the case. So my thinking was, if possible, it'd be easier to reorder the array on the back end.
I'm aware that another solution would be to move the columns on the entry sheet, which I can go down that road if necessary, but seems like it'd be easier and less overhead to just reorder the array index.
Hope that makes sense, and any help is greatly appreciated.
Thanks,
sous
Currently I'm building up an array by looping through a set of columns with code like:
Code:
For i = 1 To lSampleColumn
ReDim Preserve vStr(1 To i)
aStr = SampleDataSheet.Cells(1, i).Value & ": " & SampleDataSheet.Cells(SampleLoop, i).Value
vStr(i) = aStr
Next i
Set shp = ws.Shapes(shapename)
ws.Hyperlinks.Add shp, "", "", ScreenTip:=Join(vStr, vbCr)
That all works fine, but what I'm hoping to do is reorder the array index from {1,2,3,4,etc, etc, etc} to something like: {1,x,2,3,etc,etc,etc} or {1,x,2,4,etc,etc,etc}
The x is defined earlier in the code, it's an integer that defines what column they want to apply some color to.
Index 1 is the description (in this case country name) and will always be first. The remaining parts of the array are various values that the user assigns to the country. I started with the assumption that they'd always put the "use this value to apply colors to" in column B, but that's not always going to be the case. So my thinking was, if possible, it'd be easier to reorder the array on the back end.
I'm aware that another solution would be to move the columns on the entry sheet, which I can go down that road if necessary, but seems like it'd be easier and less overhead to just reorder the array index.
Hope that makes sense, and any help is greatly appreciated.
Thanks,
sous