LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
toggle or command and how NILELATOR Excel Programming 0 January 10th 08 01:07 AM
Command Button That Will Toggle Paige Excel Programming 10 October 31st 07 12:21 AM
Xl2003: Validation.Add method gives error from Command Button sebt Excel Programming 2 April 5th 07 03:30 PM
Xl2003: Validation.Add method gives error from Command Button sebt Excel Programming 0 April 5th 07 02:41 PM
Toggle command buttons GEB Excel Programming 4 June 23rd 05 08:33 PM


All times are GMT +1. The time now is 09:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"