Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need help with the syntax on a conditional statement in a macro.
The macro works perfectly if a list (filtered list) exists. However, if no lists exist on the page, I get an error message. I want to start my code with a condition that does the following: If no list exists Exit sub Else ........... I can take it from there. Any help would be very much appreciated. Kevin |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Kevin
It's going to be up to you to decide what constitutes "no list". Something like "there's no entries in range such and such", or if there is no entry in this cell or that cell or whatever. For instance, let's say the list would be in A1:A10 if there is a list. The following line of code would exit the sub if nothing is in that range. If Application.CountA(Range("A1:A10")) = 0 Then Exit Sub HTH Otto "DoooWhat" wrote in message oups.com... I need help with the syntax on a conditional statement in a macro. The macro works perfectly if a list (filtered list) exists. However, if no lists exist on the page, I get an error message. I want to start my code with a condition that does the following: If no list exists Exit sub Else .......... I can take it from there. Any help would be very much appreciated. Kevin |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry, I guess my initial inquiry was a little ambiguous. Let's
assume that there is ALWAYS data in the target range. When I refer to a list, I am talking about when you highlight a range, then go to Data \List\Create List. Kevin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Show it here, if it exists there | Excel Discussion (Misc queries) | |||
how do i omit the a list, and it's matches, so neither exists? | Excel Worksheet Functions | |||
A value exists in a list? | Excel Discussion (Misc queries) | |||
how to copy old price data onto new stock list if match exists? | Excel Discussion (Misc queries) | |||
Sheet name already exists | Excel Discussion (Misc queries) |