G
Guest
I have a macro that selects rows based on their data.
IE.
x = Application.WorksheetFunction.Match("AIR", Range
("J:J"), 0)
y = Application.WorksheetFunction.Match("AIR", Range
("J:J"), 1)
Rows(x & ":" & y).Copy
This will select and copy all rows containing AIR in
Column J.
When AIR is in the file that I use the macro on, it works
correctly. However, if the file does not contain AIR
(which may be the case), I want the macro to ignore it,
and go to the next part of the macro.
However, it just copies some other rows instead!
Can you help?
Jempie
IE.
x = Application.WorksheetFunction.Match("AIR", Range
("J:J"), 0)
y = Application.WorksheetFunction.Match("AIR", Range
("J:J"), 1)
Rows(x & ":" & y).Copy
This will select and copy all rows containing AIR in
Column J.
When AIR is in the file that I use the macro on, it works
correctly. However, if the file does not contain AIR
(which may be the case), I want the macro to ignore it,
and go to the next part of the macro.
However, it just copies some other rows instead!
Can you help?
Jempie