Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding to cell ranges
Have this so far:
Dim CellRng as String CellRng = "C4" PercentVal = Sheets("Sheet1").Range(CellRng).Value ***Now, how can I add 1 row to CellRng. It's in loop, and I want it to get the value for C5 next time. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding to cell ranges
I am guessing you want to go from "C4" to "C5" to "C6", etc.
change PercentVal = Sheets("Sheet1").Range(CellRng).Value into i = 3 j = 4 .. .. .. PercentVal = Sheets("Sheet1").Cells(j,i).Value and then increment j in the loop to move downward. An alternative is to use OFFSET() -- Gary's Student "Mike" wrote: Have this so far: Dim CellRng as String CellRng = "C4" PercentVal = Sheets("Sheet1").Range(CellRng).Value ***Now, how can I add 1 row to CellRng. It's in loop, and I want it to get the value for C5 next time. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding to cell ranges
Another alternative is:
PercentVal = Sheets("Sheet1").Range("C" & j).Value -- Gary''s Student "Gary''s Student" wrote: I am guessing you want to go from "C4" to "C5" to "C6", etc. change PercentVal = Sheets("Sheet1").Range(CellRng).Value into i = 3 j = 4 . . . PercentVal = Sheets("Sheet1").Cells(j,i).Value and then increment j in the loop to move downward. An alternative is to use OFFSET() -- Gary's Student "Mike" wrote: Have this so far: Dim CellRng as String CellRng = "C4" PercentVal = Sheets("Sheet1").Range(CellRng).Value ***Now, how can I add 1 row to CellRng. It's in loop, and I want it to get the value for C5 next time. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
adding ranges | Excel Discussion (Misc queries) | |||
adding ranges | Excel Programming | |||
adding two ranges | Excel Programming | |||
Adding ranges | Excel Programming | |||
Adding Cell Values to Ranges | Excel Programming |