View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default If row 2 contains nothing then move onto next macro.......

if activesheet.UsedRange.rows.count < 2 then
exit sub
end if

--
Regards,
Tom Ogilvy


" wrote:

Hello

I wondered if someone could help,

I have several (hundred) macro doing different things,

What I thought though is that if my sheets contain no data then the
macro will debug as it cannot continue.

I wanted to add a line at the beginning of each of my macro's
basically telling it which macro to visit if the row within the sheet
is zero.

Perhaps I could do this in replacement of the error message?

I have no idea what I could do to solve this but I was hoping someone
could help.

THanks in advance,

Andrea