Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Changing cell color
I have bunch of survey questions that ask for answers that rank importance.
Each question is followed by 5 cells in a row and I want to change the color of one of these cells when someone selects it. Changing the selected cell in a row would then toggle the old one and change the color of the new one picked. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Changing cell color
Lets say your questions are in column A and the answers are in cols B thru F.
Put the following macro in the worksheet code area: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim i As Long If Intersect(Target, Range("B:F")) Is Nothing Then Exit Sub r = Target.Row rs = "B" & r & ":F" & r Range(rs).ClearFormats Target.Interior.ColorIndex = 6 End Sub -- Gary''s Student - gsnu200738 "Alf" wrote: I have bunch of survey questions that ask for answers that rank importance. Each question is followed by 5 cells in a row and I want to change the color of one of these cells when someone selects it. Changing the selected cell in a row would then toggle the old one and change the color of the new one picked. |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Changing cell color
Well, not only did this work, but you even guessed the correct format of my
sheet columns A-F. Thanks very much and that was very interesting. Alf "Gary''s Student" wrote: Lets say your questions are in column A and the answers are in cols B thru F. Put the following macro in the worksheet code area: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim i As Long If Intersect(Target, Range("B:F")) Is Nothing Then Exit Sub r = Target.Row rs = "B" & r & ":F" & r Range(rs).ClearFormats Target.Interior.ColorIndex = 6 End Sub -- Gary''s Student - gsnu200738 "Alf" wrote: I have bunch of survey questions that ask for answers that rank importance. Each question is followed by 5 cells in a row and I want to change the color of one of these cells when someone selects it. Changing the selected cell in a row would then toggle the old one and change the color of the new one picked. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Color Shading Changing | Excel Discussion (Misc queries) | |||
Cell colors or text color changing when date in cell gets closer. | Excel Worksheet Functions | |||
changing cell background color | Excel Worksheet Functions | |||
Changing the cell color due to results. | Excel Discussion (Misc queries) | |||
Changing Cell Color | Excel Worksheet Functions |