ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Do not advance to next cell (https://www.excelbanter.com/excel-worksheet-functions/204709-do-not-advance-next-cell.html)

helphv

Do not advance to next cell
 
I would like to stop at a cell until something is entered into it. I even
want to stop Tab, arrow key also from allowing advancement to the next cell
in my spreadsheet until something is entered into the current cell. Data
Validation still allows Tab and arrow keys to advance, does anyone have any
ideas?

Dave

Do not advance to next cell
 
Hi,
One way: use a couple of event macros in the sheet window of the VBA editor.
Firstly:

Private Sub Worksheet_Activate()
Range("B2").Select
End Sub

Next:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Range("B2") = "" Then
Range("B2").Select
MsgBox "You must enter something into B2"
End If
Application.EnableEvents = True
End Sub

Regards - Dave.

helphv

Do not advance to next cell
 
Thanks Dave! This worked great for cell B2, but I really need it to apply to
the entire B column and also for the entire C column in my spreadsheet. Is
this possible?

"Dave" wrote:

Hi,
One way: use a couple of event macros in the sheet window of the VBA editor.
Firstly:

Private Sub Worksheet_Activate()
Range("B2").Select
End Sub

Next:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Range("B2") = "" Then
Range("B2").Select
MsgBox "You must enter something into B2"
End If
Application.EnableEvents = True
End Sub

Regards - Dave.


Dave

Do not advance to next cell
 
Hi,
Not sure I understand. Does the user have to enter data into every cell in
Columns B & C? That's about 130,000 entries in XL2003, and 2 million in
XL2007!
Dave.

helphv

Do not advance to next cell
 
Hi Dave,
I would say at least in the first 1000 rows. My spreadsheet contains only 3
fields. We just want the end user to not be able to leave columns B & C
empty in a row once they have entered an ID number in column A. I am using
XL2003. I am also using Data Validation on columns B & C because only a
range of numbers are allowed. I have left Ignor blank unchecked.
Unfortunately, Tab and arrow key allow advancement. Thank you!

"Dave" wrote:

Hi,
Not sure I understand. Does the user have to enter data into every cell in
Columns B & C? That's about 130,000 entries in XL2003, and 2 million in
XL2007!
Dave.


Dave

Do not advance to next cell
 
Hi,
Sorry, this one's a bit beyond me. Try posting again
Dave.

"helphv" wrote:

Hi Dave,
I would say at least in the first 1000 rows. My spreadsheet contains only 3
fields. We just want the end user to not be able to leave columns B & C
empty in a row once they have entered an ID number in column A. I am using
XL2003. I am also using Data Validation on columns B & C because only a
range of numbers are allowed. I have left Ignor blank unchecked.
Unfortunately, Tab and arrow key allow advancement. Thank you!

"Dave" wrote:

Hi,
Not sure I understand. Does the user have to enter data into every cell in
Columns B & C? That's about 130,000 entries in XL2003, and 2 million in
XL2007!
Dave.


helphv

Do not advance to next cell
 
Thanks Dave. I appreciate your help.

"Dave" wrote:

Hi,
Sorry, this one's a bit beyond me. Try posting again
Dave.

"helphv" wrote:

Hi Dave,
I would say at least in the first 1000 rows. My spreadsheet contains only 3
fields. We just want the end user to not be able to leave columns B & C
empty in a row once they have entered an ID number in column A. I am using
XL2003. I am also using Data Validation on columns B & C because only a
range of numbers are allowed. I have left Ignor blank unchecked.
Unfortunately, Tab and arrow key allow advancement. Thank you!

"Dave" wrote:

Hi,
Not sure I understand. Does the user have to enter data into every cell in
Columns B & C? That's about 130,000 entries in XL2003, and 2 million in
XL2007!
Dave.



All times are GMT +1. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com