skitrumpet
Technical User
Hi,
I am trying to write a procedure that if a variable (portfolio), isn't found in a range (term_portfolio), then find an alternative variable (area) in an alternative range (term_area).
The problem is that using the following does not follow the Then logic when an error was expected, i.e. no match in term_portfolio.
I'd be very grateful if someone would help me with what I'm missing.
I've tried the following:
Application.Goto reference:="term_portfolio"
If IsError(Selection.Find(what:=portfolio)) = True Then
Application.Goto reference:="term_area"
Selection.Find(what:=area).Activate
reporting_category = ActiveCell.Offset(0, 2)
Sheets("Deals").Select
ActiveCell = reporting_category
Else
Selection.Find(what:=portfolio).Activate
reporting_category = ActiveCell.Offset(0, 1)
Sheets("Deals").Select
ActiveCell = reporting_category
End If
Many thanks in advance
Adam
I am trying to write a procedure that if a variable (portfolio), isn't found in a range (term_portfolio), then find an alternative variable (area) in an alternative range (term_area).
The problem is that using the following does not follow the Then logic when an error was expected, i.e. no match in term_portfolio.
I'd be very grateful if someone would help me with what I'm missing.
I've tried the following:
Application.Goto reference:="term_portfolio"
If IsError(Selection.Find(what:=portfolio)) = True Then
Application.Goto reference:="term_area"
Selection.Find(what:=area).Activate
reporting_category = ActiveCell.Offset(0, 2)
Sheets("Deals").Select
ActiveCell = reporting_category
Else
Selection.Find(what:=portfolio).Activate
reporting_category = ActiveCell.Offset(0, 1)
Sheets("Deals").Select
ActiveCell = reporting_category
End If
Many thanks in advance
Adam