C
CB
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("TestOF.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
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("TestOF.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