Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet where the user has to answer yes or no to 4 questions,
in cells C30, C31, C32, and C34. I do not want them to be able to select any other unlocked cell in the spreadsheet AFTER C34 until/unless they have answered C30, C31, C32 and C34. Can someone advise how to do this; have been struggling for awhile and my mind is fried.....thanks...pc |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Paige,
Paige wrote: I have a spreadsheet where the user has to answer yes or no to 4 questions, in cells C30, C31, C32, and C34. I do not want them to be able to select any other unlocked cell in the spreadsheet AFTER C34 until/unless they have answered C30, C31, C32 and C34. Can someone advise how to do this; have been struggling for awhile and my mind is fried.....thanks...pc This is a bit ugly, but it should work for you: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Application.Union(Target, Range("C30:C32"), _ Range("C34")).Cells.Count < 4 Then '/ trying to select something else If Application.CountA(Range("C30:C32,C34")) < 4 Then MsgBox "You must answer all 4 questions to proceed." Application.Goto Range("C30") End If End If End Sub This code must reside behind the worksheet containing the questions (right-click sheet tab and select View Code, paste this code into the resulting code pane). -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paige,
How about: With ThisWorkbook.Worksheets(YourWS) .Unprotect .ScrollArea = OKRangeAs string .EnableSelection = xlUnlockedCells .Protect , , , , True End With NickHK "Paige" wrote in message ... I have a spreadsheet where the user has to answer yes or no to 4 questions, in cells C30, C31, C32, and C34. I do not want them to be able to select any other unlocked cell in the spreadsheet AFTER C34 until/unless they have answered C30, C31, C32 and C34. Can someone advise how to do this; have been struggling for awhile and my mind is fried.....thanks...pc |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jake, I used your code last night and it worked - thanks! Nick, will try
yours today also.....thanks so much to both of you for taking the time to respond. "Paige" wrote: I have a spreadsheet where the user has to answer yes or no to 4 questions, in cells C30, C31, C32, and C34. I do not want them to be able to select any other unlocked cell in the spreadsheet AFTER C34 until/unless they have answered C30, C31, C32 and C34. Can someone advise how to do this; have been struggling for awhile and my mind is fried.....thanks...pc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I prevent a user from entering data in a cell? | Excel Discussion (Misc queries) | |||
Prevent user from using Name | Excel Discussion (Misc queries) | |||
Past Special changes results for macros... how to prevent this | Excel Programming | |||
prevent a user leaving a blank cell in excel2003 | Excel Discussion (Misc queries) | |||
How to Get Past the User Form? | Excel Programming |