Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get an error on this simple line of code...
st1 = st1.Offset(1, 0) st1 is a range... is there anyother way to make st1 step one cell down? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi John,
Try: Set st1 = st1.Offset(1,0) --- Regards, Norman "John" wrote in message ... I get an error on this simple line of code... st1 = st1.Offset(1, 0) st1 is a range... is there anyother way to make st1 step one cell down? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi John,
John wrote: I get an error on this simple line of code... st1 = st1.Offset(1, 0) st1 is a range... is there anyother way to make st1 step one cell down? Since st1 is a Range object, you need to use the Set command if you want to change its reference. Otherwise, VBA is going to assign the Value of the cell below st1 to the cell referred to by st1. You shouldn't get an error, though - that line of code executes for me, it just yields unexpected results. Dim st1 As Range Set st1 = Range("A1") Set st1 = st1.Offset(1,0) '/ now st1 refers to B1 -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks :)
"Norman Jones" wrote: Hi John, Try: Set st1 = st1.Offset(1,0) --- Regards, Norman "John" wrote in message ... I get an error on this simple line of code... st1 = st1.Offset(1, 0) st1 is a range... is there anyother way to make st1 step one cell down? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLookup Variable Offset | Excel Discussion (Misc queries) | |||
Variable worksheet name in offset | Excel Worksheet Functions | |||
Using Offset on Variable Dinensioneds Object | Excel Programming | |||
Offset with variable | Excel Programming | |||
How to Offset string variable? | Excel Programming |