LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MCB MCB is offline
external usenet poster
 
Posts: 3
Default fixing macro to highlight a row if a checkbox is checked

I've inherited a workbook with the request to put a function in the "totals" tab, which was removed some time between the original version and the one I received. The function highlights the row accompanying a checkbox if the box is checked (basically just allowing the person who uses the workbook to keep better visual track of which of the 20 sections of the workbook she has completed). I've re-created the columns, checkboxes, etc., and copied the macro from the original workbook. The function kind of works now - when you click the checkbox, the row does turn yellow, but you also get messages for all the rows, and when you uncheck the checkbox the highlighting doesn't go away. I have zero experience with macros, so I'm surprised I've gotten even that far. Below is the code for the macro, which is pretty much Greek to me. Any assistance would be much appreciated. (And let me know if I've omitted any important info.

******
Sub HighlightRow(

' HighlightRow Macr
' Macro recorded 6/20/2003 by Lisa Moor

Application.ScreenUpdating = Fals

Range("A29").Selec
If ActiveCell.Value 0 The
MsgBox "A29 not zero

ActiveSheet.Unprotec

For i = 9 To 2
Range("A" & i).Selec
If ActiveCell.Value = 1 The
MsgBox "i is 1

Range("E" & i & ":AE" & i).Selec

With Selection.Interio
.ColorIndex = 1
.Pattern = xlSoli
.PatternColorIndex = xlAutomati
End Wit

Els

MsgBox "i is 0

Range("E" & i & ":AD" & i).Selec

With Selection.Interio
.ColorIndex = xlNon
.Pattern = xlSoli
.PatternColorIndex = xlAutomati
End Wit


End I

Next

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=Tru

Application.ScreenUpdating = Tru

End I

End Su


 
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
IF checkbox is checked/unchecked, Cell.value = yes/no James Excel Worksheet Functions 3 October 3rd 08 06:56 PM
Checkbox checked then show more checkboxes Sara New Users to Excel 3 September 10th 08 07:16 PM
How to have Checkbox A uncheck with checked Checkbox B Texas Aggie Excel Discussion (Misc queries) 3 July 20th 07 10:58 PM
Is checkbox is checked? Fred S Excel Discussion (Misc queries) 2 October 19th 05 03:53 AM
checkbox - default checked or un-checked barrfly Excel Programming 1 December 22nd 03 05:00 PM


All times are GMT +1. The time now is 08:04 AM.

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"