Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values not matching
I am trying to use an array to change a column number, based on the
array values. However, the variable (colnum) remains starts at 0, then 1, etc. instead of 2,6,8,10,12: Dim c As Range Dim colnumarr As Variant Dim colnum As Integer colnumarr = Array(2, 6, 8, 10, 12) For colnum = LBound(colnumarr) To UBound (colnumarr) For Each c In Range(tlcapscell, blcapscell).Offset(0, colnum) c.Value = UCase(c.Value) Next Next Thanks... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values not matching
You have probably figured it out by now. The LBound and UBound of your array
run from 0 To to the index count - 1. In your case 0 To 5. To get the values of each index number in the arrary you can use colnumarr(0) for a value of 2, colnumarr(1) for a value of 4, etc. "Steve" wrote: I am trying to use an array to change a column number, based on the array values. However, the variable (colnum) remains starts at 0, then 1, etc. instead of 2,6,8,10,12: Dim c As Range Dim colnumarr As Variant Dim colnum As Integer colnumarr = Array(2, 6, 8, 10, 12) For colnum = LBound(colnumarr) To UBound (colnumarr) For Each c In Range(tlcapscell, blcapscell).Offset(0, colnum) c.Value = UCase(c.Value) Next Next Thanks... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
array values not matching
For Each c In Range(tlcapscell,blcapscell).Offset(0, colnumarr(colnum))
Steve wrote: I am trying to use an array to change a column number, based on the array values. However, the variable (colnum) remains starts at 0, then 1, etc. instead of 2,6,8,10,12: Dim c As Range Dim colnumarr As Variant Dim colnum As Integer colnumarr = Array(2, 6, 8, 10, 12) For colnum = LBound(colnumarr) To UBound (colnumarr) For Each c In Range(tlcapscell, blcapscell).Offset(0, colnum) c.Value = UCase(c.Value) Next Next Thanks... -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Finding Most Recent Values in Col1 -- Summing Matching Values | Excel Discussion (Misc queries) | |||
return values from an array based on matching text value | Excel Worksheet Functions | |||
Matching numbers in an Array and returning values for matched numb | Excel Discussion (Misc queries) | |||
Matching Values from an Array | Excel Worksheet Functions | |||
Fill values into a listbox matching selected values from a combobox | Excel Programming |