gisvpn
asked on
Problems selecting Columns and formatting
Hi,
I am working in Excel 2010 and I have problems referencing where I want to format.
Columns("B:B").Select
With Selection.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
I have the above code but find it really difficult to select this place and it is with mainly this statement Columns("B:B").Select.
I try and many varients like it
sheets("xxx").Columns("B:B ").Select
but it does not like this at all and I get it to work.
Can someone please tell me the correct way to reference an area to then format it or do something with it?
Thanks,
GISVPN
I am working in Excel 2010 and I have problems referencing where I want to format.
Columns("B:B").Select
With Selection.Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
I have the above code but find it really difficult to select this place and it is with mainly this statement Columns("B:B").Select.
I try and many varients like it
sheets("xxx").Columns("B:B
but it does not like this at all and I get it to work.
Can someone please tell me the correct way to reference an area to then format it or do something with it?
Thanks,
GISVPN
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad this answered you question.
What do you mean by "manipulate code"? And yes, VBA supports IF statements, too.
You should start new questions for each of these issues.
cheers, teylyn
What do you mean by "manipulate code"? And yes, VBA supports IF statements, too.
You should start new questions for each of these issues.
cheers, teylyn
ASKER
Hey Teylyn,
It was just to check I could use this method to reference a column or specific cell which I think it does ;)
Thanks,
GISVPn
It was just to check I could use this method to reference a column or specific cell which I think it does ;)
Thanks,
GISVPn
Well, yes. The code above references column B in a With statement. In the same manner, you can reference other ranges.
ASKER
Thanks
Gisvpn