Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I found this bit and just love it, but really would like it to be
disabled on startup, and have off/on button I can clickit off to copy/paste etc (this stops copy/paste when used). Also need off button to return row to old format. Any ideas how I can do all this, or if it can be done at all? Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Const cnNUMCOLS As Long = 256 Const cnHIGHLIGHTCOLOR As Long = 36 'default lt. yellow Static rOld As Range Static nColorIndices(1 To cnNUMCOLS) As Long Dim i As Long If Not rOld Is Nothing Then 'Restore color indices With rOld.Cells If .Row = ActiveCell.Row Then Exit Sub 'same row, don't restore For i = 1 To cnNUMCOLS .Item(i).Interior.ColorIndex = nColorIndices(i) Next i End With End If Set rOld = Cells(ActiveCell.Row, 1).Resize(1, cnNUMCOLS) With rOld For i = 1 To cnNUMCOLS nColorIndices(i) = .Item(i).Interior.ColorIndex Next i .Interior.ColorIndex = cnHIGHLIGHTCOLOR End With End Sub Thanks Dave (AKA Ryk) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I turn the Macro Stop Recording Toolbar on and off? | Excel Discussion (Misc queries) | |||
how do I email amacro? | Excel Worksheet Functions | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
link to combobox | Excel Discussion (Misc queries) | |||
Editing a simple macro | Excel Worksheet Functions |