Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA BackColor

Status
Not open for further replies.

Ascentient

IS-IT--Management
Nov 4, 2002
267
Is there a way to use the Selection method to change the BackColor for a selection of cells?

Code:
    Range("k9:p38").Select
    Selection.BackColor = &H80000005
I thought the above might work, but I get the following error: Run-time error '438' Object does not support this property or method.

Ascent
 
Forum707 is for Office VBA, this is Access VBA, but I don't think the excel range object has a backcolor property, I'd assume something like

[tt] Selection.interior.color = &H80000005[/tt]

but it should be enough with

[tt] Range("k9:p38").interior.color = &H80000005[/tt]

I think?

Roy-Vidar
 
Although I supplied the wrong hex code, this will do the trick.

Thanks Roy!

Ascent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top