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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel formatting from VB (almost there!)

Status
Not open for further replies.

Tommyhat

Programmer
Sep 10, 2004
96
CA
I'm trying to add a back colour if the user has set collumn heads on in a flexgrid.

so i had this code from what ive gathered from looking up old posts:

If mnuHeadOn.Checked = True Then
ws.Range("A1:A5").Select
ws.Selection...
End If

but it complains my worksheet (ws) doesnt support .selection

first, what do i use to refer to the cells i selected with .select
second, what's the syntax to change back colour?

Thanks a bunch!
 
I figured it out myself.

ws.Cells(j, m).interior.colorindex = 15
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top