Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to move to another cell | New Users to Excel | |||
Macro to move row from one worksheet to another | Excel Discussion (Misc queries) | |||
Macro to move a row from one table to another | Excel Worksheet Functions | |||
Macro to move to next column | Excel Discussion (Misc queries) | |||
macro to move cursor | Excel Programming |