![]() |
If row 2 contains nothing then move onto next macro.......
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 |
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 |
If row 2 contains nothing then move onto next macro.......
Hi Tom,
I did get this working but there is so much macro coding for the entire process that it's a nightmare. My macros all appear to be doing the same thing for each sheet in the workbook......instead I have created a macro for each of the sheets......not the easiest way I bet. Then I have calculations on bold figures........my macros stop working when there is something it cannot find.... I've terribly wrong with all this..... thanks for your help all the same, im very grateful, andrea On 12 Jun, 21:29, Tom Ogilvy wrote: 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- Hide quoted text - - Show quoted text - |
All times are GMT +1. The time now is 09:09 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com