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

Manipulating Excel: How to change cell Color 1

Status
Not open for further replies.

mkjp2011

Programmer
Aug 24, 2010
15
US
How can I change the background color of one cell within a EXTRA! Basic Macro?
 


Hi,

Post whatever code you already have that instantiates the Excel application object and references an Excel workbook/worksheet.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Set excelReport = CreateObject("Excel.Application")
excelReport.Workbooks.Add
Set objSheet1 = excelReport.ActiveWorkbook.WorkSheets(1)
 


Code:
Set excelReport = CreateObject("Excel.Application")
Set xlWB = excelReport.Workbooks.Add
Set objSheet1 = xlWB.WorkSheets(1)  

objSheet1.cells(1,1).interior.color = vbred

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top