Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activecell Offset
I am using Excel 97.
I have some code which finds an empty row and then populates cells in the 13th column for the previous 7 rows. Using activecell.offset(-7,13) My code debugs when there aren't 7 rows before the empty row! Can someone assist me with some code which checks to see if there are 7 rows before the empty row and if not moves to the next sheet. ---- Mark |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activecell Offset
Hi, You can simply use ActiveCell.Row which will return the row number of the active cell. If it is greater than 7 you have atleast 7 rows up. If ActiveCell.Row 7 Then .... your code. Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activecell Offset
Or if you are not selecting cells and just have a variable assigned to the
first cell in your newly found empty row (such as rCell), then use if rCell.row7 then 'your code end if "Mark" wrote: I am using Excel 97. I have some code which finds an empty row and then populates cells in the 13th column for the previous 7 rows. Using activecell.offset(-7,13) My code debugs when there aren't 7 rows before the empty row! Can someone assist me with some code which checks to see if there are 7 rows before the empty row and if not moves to the next sheet. ---- Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ActiveCell.Offset Question | New Users to Excel | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
Sum Activecell Offset Problem | Excel Worksheet Functions | |||
ActiveCell.Offset w/ VBA | Excel Programming | |||
activecell offset | Excel Programming |