arcross
asked on
Add condition to cell in Excel
Hi, im exporting data to an excel sheet.
What id like to do is to gice a condition to a cell.
Lets say if the cell is > or < than 100 then the background color changes.
Ive added formulas to cells and i formatting the sheet using vb.net but i dont know how to set a condition.
thanks
What id like to do is to gice a condition to a cell.
Lets say if the cell is > or < than 100 then the background color changes.
Ive added formulas to cells and i formatting the sheet using vb.net but i dont know how to set a condition.
thanks
ASKER
thanks for that.
But how can i use the formatting using just objects?
Im not referencing to the excel library to avoid conflict with versions.
im using
dim excel as object
Excel = CreateObject("Excel.Applic ation")
But how can i use the formatting using just objects?
Im not referencing to the excel library to avoid conflict with versions.
im using
dim excel as object
Excel = CreateObject("Excel.Applic
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The attached snippet shows a simple example.
btw, with Excel where I don't know the methods or properties to use, I often find it helpful to just start recording a macro and then perform the desired actions manually. The macro is generally not exactly what I want, but it often reveals the methods or properties that are required.
Cheers,
Randy
Open in new window