Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi - I am trying to increment a value in a range, as below. I get a message
saying "Expected list seperator or )" dim ii as int For ii = 7 To 19 Range("M" & str(ii):"S"+str(ii)).Select do stuff next Have tried changing & for + and taking out str... Any thoughts? Cheers Andrew |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The first problem you have is that the colon needs to go inside the
string: Range("M" & ii & ":S" & ii).Select The second problem is the Str() returns a value with a leading space (if positive) so M & Str(ii) returns "M 7" instead of "M7" As shown above, you can simply use the integer variable. OTOH, you could also do less string manipulation: For ii = 7 to 9 Range("M" & ii).Resize(1, 7).Select Next ii or For ii = 7 to 9 Cells(ii, 13).Resize(1, 7).Select Next ii etc. In article , "Andreww" wrote: Hi - I am trying to increment a value in a range, as below. I get a message saying "Expected list seperator or )" dim ii as int For ii = 7 To 19 Range("M" & str(ii):"S"+str(ii)).Select do stuff next Have tried changing & for + and taking out str... Any thoughts? Cheers Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
lookup on values between ranges | Excel Discussion (Misc queries) | |||
Sumproduct values from two ranges | Excel Worksheet Functions | |||
allow search on ranges of values | Excel Worksheet Functions | |||
parsing number ranges | Excel Discussion (Misc queries) | |||
Assigning ranges for values (e.g., $1,005 the range is ">$1K to 5K | Excel Worksheet Functions |