Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveCell.Offset Question ash3154 New Users to Excel 5 September 12th 09 01:46 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Sum Activecell Offset Problem George Andrews Excel Worksheet Functions 3 May 22nd 05 12:12 AM
ActiveCell.Offset w/ VBA Bob Umlas[_3_] Excel Programming 2 September 4th 04 02:58 PM
activecell offset rvik Excel Programming 1 December 24th 03 07:47 AM


All times are GMT +1. The time now is 07:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"