Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Prevent User from Going Past a Certain Cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Prevent User from Going Past a Certain Cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Prevent User from Going Past a Certain Cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Prevent User from Going Past a Certain Cell

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
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
How do I prevent a user from entering data in a cell? jaydub100 Excel Discussion (Misc queries) 1 August 25th 09 03:14 AM
Prevent user from using Name Matlock Excel Discussion (Misc queries) 5 March 13th 08 04:58 AM
Past Special changes results for macros... how to prevent this Matt[_33_] Excel Programming 1 September 30th 05 10:14 PM
prevent a user leaving a blank cell in excel2003 Ian Varty Excel Discussion (Misc queries) 1 April 15th 05 01:41 PM
How to Get Past the User Form? JimFor Excel Programming 2 December 26th 04 01:38 AM


All times are GMT +1. The time now is 10:34 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"