View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
StargateFan[_2_] StargateFan[_2_] is offline
external usenet poster
 
Posts: 12
Default Make this into a toggle command? [XL2003]

After a few days working with this file, I "finetuned" the macros so
that they give me the results I need. I'm very sure there's a better
way to do these things but these do the job. The first is tied to a
button, the second users have to access via the macros menus.

----------------------------------------------------------------------
Sub DONE_Crosses_off_line() ' Columns A:B

ActiveSheet.Unprotect 'place at the beginning of the code

Dim Rw As Long
Rw = ActiveCell.Row
' With Range(Cells(Rw, 1), Cells(Rw, 2)).Font ' Cells(Rw,1) =
start cell ; Cells(Rw,2) = end cell
With Range(Cells(Rw, 1), Cells(Rw, 2)).Font
.Strikethrough = True
End With
With Range(Cells(Rw, 1), Cells(Rw, 3)).Font
.Color = RGB(255, 0, 0) ' change colour to RED
.Bold = True
End With

ActiveSheet.Protect ' place at end of code
End Sub
----------------------------------------------------------------------
Sub a_Strikethrough_Remove() ' Columns A:B
ActiveSheet.Unprotect 'place at the beginning of the code

Dim Rw As Long
Rw = ActiveCell.Row
' With Range(Cells(Rw, 1), Cells(Rw, 2)).Font ' Cells(Rw,1) =
start cell ; Cells(Rw,2) = end cell
With Range(Cells(Rw, 1), Cells(Rw, 2)).Font
.Strikethrough = False
End With
With Range(Cells(Rw, 1), Cells(Rw, 3)).Font
.Color = RGB(0, 0, 0) ' change colour back to BLACK
.Bold = False
End With

ActiveSheet.Protect ' place at end of code
End Sub
----------------------------------------------------------------------

Thanks. :oD