LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Frantic Excel-er
 
Posts: n/a
Default Macro - message box if find nothing

Hi All,

I currently have a huge macro that I use to import .asc files into excel for
validation, and other things. This macro separates project accounts from non
project accounts and performs a series of tasks on the project accounts. The
project accounts can be differentiated from non project accounts because they
all have an "X" in them...

So, in my code, I first have to import the delimited data, set up column
breaks, and then sort by my account column to get all of the account data at
the bottom of the wkst...(code is already written for this, and I have been
working on it for a month, so I don't want to change it). With that said, I
have my macro find "X" and then put a page break between all the project
accounts, and the non project accounts so I can then do all my tasks with
project accounts...

So, now that I explained some stuff....here is the problem (question)...
If the macro does not find any "x" in column C, then it will pop up an error
saying macro can't run...etc...etc....

What I would like for it to do is pop up a message box that says " No
Project Accounts Found", and then have the macro stop there, because all
other tasks past that point are for the projects.

Here is what part of my code looks like:

(lots of stuff before this...vlookup tables, formatting,etc)

Sheets("Modified").Select
Selection.Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("C:C").Find(What:="x").EntireRow.Insert
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Sort Key1:=Range("D:D"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Any suggestions on how I can get it to put that message box in??????

Thanks in advance, and sorry for being wordy....

Sara
 
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
How do I use find in a macro in Excel Layna Excel Worksheet Functions 2 May 20th 05 02:20 PM
How can avoid the security Macro message ... John B Excel Discussion (Misc queries) 1 March 29th 05 07:43 PM
Cannot find macro New users New Users to Excel 2 February 17th 05 05:01 PM
UDF and Calculation tree Ken Wright Links and Linking in Excel 1 February 6th 05 04:58 PM
Can't find macro Jim Excel Worksheet Functions 2 December 2nd 04 01:26 PM


All times are GMT +1. The time now is 02:39 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"