LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
CB CB is offline
external usenet poster
 
Posts: 97
Default Match Error Handling

I am referencing a project name in one workbook and using the match function
to find the same in another workbook and returning a number, the row which
the project name was found. What I need to have happen is if there is no
match an error message will pop up telling the user there is no match. My
code keeps quitting once there is no match how can I make it continue to the
error message.

My code is below:


Sub AutoPopulate()

Dim PRow As Int
Call OpenWorkbook

'Tells us what Row the project is in
PRow =
Application.WorksheetFunction.Match(Workbooks("Tes tOF.xls").Worksheets(ActiveTab).Range("d2"),
Workbooks("milestones.xls").Worksheets("data sheet").Range("A6:A400"), 0)

If IsError(PName) Then
MsgBox ("Project X can not be found please make sure the name appears
exactly as it does in PTT-PMA")
Else

Thanks

 
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
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Set Error handling INSIDE error-trap Michelle Excel Programming 6 May 3rd 08 03:30 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM
Error Handling with a Match Function. Hari Prasadh Excel Programming 5 February 2nd 05 04:11 PM


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