lhernandez
Active Member
- Joined
- May 22, 2006
- Messages
- 282
Hello,
I am trying to select a range for an unknown variable. I have a macro searching for a match, once found it is printed in a different worksheet, if the variable is not found I would like to highlight it in the original sheet and on the new worksheet.
So, for example, I am using j to increment through the rows of the original sheet to find a match and
if vrFound = false then
I would like to select the row and highlight it in sheet one (original sheet)
and select the row and highlight it in sheet2 (new sheet.)
I am using
of course this does not work and I have tried
and this does not work either.
Anything would help
Thank you
I am trying to select a range for an unknown variable. I have a macro searching for a match, once found it is printed in a different worksheet, if the variable is not found I would like to highlight it in the original sheet and on the new worksheet.
So, for example, I am using j to increment through the rows of the original sheet to find a match and
if vrFound = false then
I would like to select the row and highlight it in sheet one (original sheet)
and select the row and highlight it in sheet2 (new sheet.)
I am using
Code:
If vrFound = False Then
Worksheets("Sheet1").Cells(j, 1).Select to Worksheets("Sheet1").Cells(j, 16).Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
end if
Code:
If vrFound = False Then
Worksheets("Sheet1").range("Aj:Ap").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
end if
Anything would help
Thank you