still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 838
- Office Version
- 365
- Platform
- Windows
This is a sample to show the problem I’m having
I have data in A1:H25 that has a fill of light blue
Using the macro recorder, I click on the relative reference
I then Click> Shift + End Down and move to the right 8 cells
This high lights A1:H25
I then format the cells as “No fill” and shut off the recorder
I then add five more cells down and 8 to the right
And format the new cells with a fill
I then run the macro putting the cursor on A1 and the macro runs perfect
BUT only to A1:H25 not A1:H33
The new 5 rows are still formatted with a fill
What I’m trying to do is change the fill format of the results of an advance search result. The results will not always have the same number of rows.
I don’t know how to change “ ActiveCell.Range("A1:H21").Select “
to match the “Selection.End(xlDown)).Select”
mike
I have data in A1:H25 that has a fill of light blue
Using the macro recorder, I click on the relative reference
I then Click> Shift + End Down and move to the right 8 cells
This high lights A1:H25
I then format the cells as “No fill” and shut off the recorder
I then add five more cells down and 8 to the right
And format the new cells with a fill
I then run the macro putting the cursor on A1 and the macro runs perfect
BUT only to A1:H25 not A1:H33
The new 5 rows are still formatted with a fill
VBA Code:
Sub Macro8()
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Range("A1:H21").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
What I’m trying to do is change the fill format of the results of an advance search result. The results will not always have the same number of rows.
I don’t know how to change “ ActiveCell.Range("A1:H21").Select “
to match the “Selection.End(xlDown)).Select”
mike