Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 15, 7:10*pm, "JLGWhiz" wrote:
Be sure the sheet you want to change is the active sheet. *I assume you know how to tie the code to the button. Private Sub CommandButton1_Click() * For Each c In ActiveSheet.UsedRange.Cells * * * If c.Interior.ColorIndex 0 Then * * * * * c.Interior.ColorIndex = xlNone * * * * * With c.Borders(xlDiagonalDown) * * * * * * .LineStyle = xlContinious * * * * * * .Weight = xlThin * * * * * End With * * * End If * *Next End Sub "CR" wrote in message m... I'm using Excel 2003 I have a range of cells ("B27:R63") some of which are RGB(255, 128, 128) These cells will change every week.. I have a CommandButton1_Click that needs to go through the range and find those colored cells and replace the color to none and add diagonal borders how is code tied to a button? button1.onclick="mymacro"? thanks LineStyle = xlContinuous * * * *.Weight = xlThin * * * *.ColorIndex = xlAutomatic Can someone please help with a Macro so I don't have to do this by hand twice a week for the next seventeen weeks? My pea brain got close a couple of times but I got frustrated and deleted the entire thing to start over. Thought I'd ask for help first. Thanks CR |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding row without borders | Excel Discussion (Misc queries) | |||
Borders | Excel Programming | |||
Borders | Excel Worksheet Functions | |||
Adding new rows with borders | Excel Programming | |||
Adding Borders | Excel Worksheet Functions |