csehz
asked on
VBA Excel 2010 - Selecting columns
Dear Experts,
Can you please have a short look on the attached code, in the first row I would like to select data range in column A and also in column E, after changing their colors.
In the current version it works but also changing color for B, C, D column data ranges.
Could you advise how to change it that only the A and E column data range should be changed?
thanks,
Can you please have a short look on the attached code, in the first row I would like to select data range in column A and also in column E, after changing their colors.
In the current version it works but also changing color for B, C, D column data ranges.
Could you advise how to change it that only the A and E column data range should be changed?
thanks,
Range("A2:A" & LastRowWithValue & "", "E2:E" & LastRowWithValue & "").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 14540253
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ASKER
Thanks basically I have this version through the macro recorder, just thought that maybe in one row can be done the selection.
Because anyway I have five such columns and looks the code quite long compare to the fact that it is just colouring
Because anyway I have five such columns and looks the code quite long compare to the fact that it is just colouring
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks that one I have searched
I think it will also work with subtle shift inyour commas and quotes to specify a non-contiguous range:
Range("A2:A" & LastRowWithValue & ",E2:E" & LastRowWithValue).Select
Sorry should have refreshed before posting
ASKER
Never mind thanks that you dealt with the question,
thanks,
Zsolt
thanks,
Zsolt
Open in new window