Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Help! Need quick answer how to handle no data condition for filter

I'm on a short deadline, so I need help right away if possible. I have
a macro creating an advanced filter that extracts data from a hidden
datasheet based on a selected cell in a source sheet. On previous
sheets, I tested for data to filter using info on the source sheet, but
I have a new source sheet that doesn't have the info on it. Is there a
way to trap the filter results if there is no applicable data and send
it to the MsgBox I already created that says there's no revelant data
for that county? Right now, I'm getting a macro error 1004,
"Application defined or object defined error" when it tries to apply
the filter.
Thanks for the help!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Help! Need quick answer how to handle no data condition for filter

Some error trapping should work, something like:

On Error GoTo ErrorHandler

And then:

ErrorHandler:
'code for msgbox

That should work.



*** Sent via Developersdex http://www.developersdex.com ***
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help! Need quick answer how to handle no data condition for filter

I don't know how you extract the filtered data, but I use code like

Set rng = rngToFilter.SpecialCells(xlCellTypeVisible)

so you can test that for Nothing

If Not rng Is Nothing Then

etc.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"davegb" wrote in message
oups.com...
I'm on a short deadline, so I need help right away if possible. I have
a macro creating an advanced filter that extracts data from a hidden
datasheet based on a selected cell in a source sheet. On previous
sheets, I tested for data to filter using info on the source sheet, but
I have a new source sheet that doesn't have the info on it. Is there a
way to trap the filter results if there is no applicable data and send
it to the MsgBox I already created that says there's no revelant data
for that county? Right now, I'm getting a macro error 1004,
"Application defined or object defined error" when it tries to apply
the filter.
Thanks for the help!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Need A Quick Answer Please! sopranoiam Excel Discussion (Misc queries) 1 January 24th 08 09:12 PM
Quick answer please! R.P.McMurphy Excel Worksheet Functions 5 January 12th 06 07:58 PM
two quick questions on excel. please answer as soon as possible... Microofficetester Excel Worksheet Functions 6 December 17th 04 01:42 AM
Need a Quick answer on this one......... Dan B Excel Programming 6 June 4th 04 11:38 PM
Simple Question, need quick answer please Stevie_mac Excel Programming 1 April 1st 04 03:52 PM


All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"