if header row leave a statement

D

duhrl

I'm a newbie to excel macro's, i know enough to get into trouble.
What i have is a macro that when I run it i need it to find the firs
row of data, But if that row happens to be A3 I need it to leave
statment "No exceptions as of" in A4 since A3 is my header row.

I believe

Dim rng1 As Range
Set rng1 = wstest.Range("A65536").End(xlUp)

is used to find the first row with data working from the bottom of th
column and working up. what is needed after this to place my comment?

thanks for your assistance
 
S

Susan

if i understand you correctly:

Dim myLastRow as long
dim myFirstRow as long
Dim rng1 As Range

myLastRow = wstest.range("A65536").end(xlUp)
'this will find the LAST row of data

myFirstRow = wstest.range("A1").end(xlDown)
'this will find the FIRST row of data (after A1)

Set rng1 = wstest.Range("A" & myFirstRow +1 & ":xxxxx" & myLastRow)
'i added 1 to your first row to leave space for your comment
'xxxxx represents your last column, i didn't know what it was

hope that helps! watch out for text wrapping - if you get any red
text it means the line broke on text wrapping.
:)
susan
 
Top