Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code cleanup help please
I have set up a sheet that has 10 command buttons which change colo when worksheet cells contain something other than a "" Here is the cosr I'm using too effect this With ThisWorkbook.Sheets("Costs").CommandButton1 If Range("a100").Value < "" Then .BackColor = &HFFFF00 Else .BackColor = &HE0E0E0 End If End With With ThisWorkbook.Sheets("Costs").CommandButton2 If Range("a101").Value < "" Then .BackColor = &HFFFF00 Else .BackColor = &HE0E0E0 End If End With etc etc Is there a more efficient way to do this? Cheers Peter (new to VBA -- peter.thompso ----------------------------------------------------------------------- peter.thompson's Profile: http://www.excelforum.com/member.php...fo&userid=2968 View this thread: http://www.excelforum.com/showthread.php?threadid=49542 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data cleanup | Excel Worksheet Functions | |||
Can someone help Cleanup my recorded macro | Excel Discussion (Misc queries) | |||
Log File CleanUp | Excel Programming | |||
Leo Heuser format cleanup code, and a question | Excel Programming | |||
Source Data Code Cleanup Help | Excel Programming |