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

change excel worksheet cell backcolor programatically

Status
Not open for further replies.

harshaddesai

Programmer
Mar 25, 2002
24
0
0
IN
Hi
Can anyone tell me how to change the backcolor of an excel workseet cell(only a particulat cell) programatically through vb . Please help .. i'm stuck up badly ....
thanks in advance
Harshad

Even the word impossible says "I'm possible"
 
Try something like this
Code:
With objExcel.Workbooks(
Code:
Wrkbook
Code:
).Worksheets(
Code:
Wrksheet
Code:
).Range(
Code:
Cell
Code:
).Interior
    .ColorIndex = 6
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
End With
hope this helps
Andreas
 
myExcelWorksheet.Range("E9").Interior.Color = vbBlue

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top