Code cleanup help please
- From: peter.thompson <peter.thompson.20fg5m_1135230901.6389@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 Dec 2005 23:53:07 -0600
I have set up a *** that has 10 command buttons which change color
when work*** 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.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29686
View this thread: http://www.excelforum.com/showthread.php?threadid=495425
.
- Follow-Ups:
- Re: Code cleanup help please
- From: Norman Jones
- Re: Code cleanup help please
- From: Norman Jones
- Re: Code cleanup help please
- From: Excelibur
- Re: Code cleanup help please
- Prev by Date: Another way to trigger a macro?
- Next by Date: Re: Error
- Previous by thread: Another way to trigger a macro?
- Next by thread: Re: Code cleanup help please
- Index(es):
Loading