Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Must be first

I need someone entering information to a worksheet to
enter into a specific cell first. It must be the first
thing they do so is there a way to code a message box
which would pop up to say "you must enter a value in A1
before anywhere else" if they try and enter anywhere else?

Thanks




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Must be first

Ronnie

You could put code in the Workbook_Open() event like so

Private Sub Workbook_Open()
MsgBox "You must enter data in Cell A1 first", vbOKOnly + vbQuestion
Worksheets("Sheet1").Activate
Range("A1").Select
End Sub

It fires when the workbook is open, displays a msgbox, activates sheet1 and
selects A1 on that sheet

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Ronnie Coleman" wrote in message
...
I need someone entering information to a worksheet to
enter into a specific cell first. It must be the first
thing they do so is there a way to code a message box
which would pop up to say "you must enter a value in A1
before anywhere else" if they try and enter anywhere else?

Thanks






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Must be first

You would also need to trap input on the sheet to ensure A1 is completed
before allowing anything else, using the Change event.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nick Hodge" wrote in message
...
Ronnie

You could put code in the Workbook_Open() event like so

Private Sub Workbook_Open()
MsgBox "You must enter data in Cell A1 first", vbOKOnly + vbQuestion
Worksheets("Sheet1").Activate
Range("A1").Select
End Sub

It fires when the workbook is open, displays a msgbox, activates sheet1

and
selects A1 on that sheet

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Ronnie Coleman" wrote in message
...
I need someone entering information to a worksheet to
enter into a specific cell first. It must be the first
thing they do so is there a way to code a message box
which would pop up to say "you must enter a value in A1
before anywhere else" if they try and enter anywhere else?

Thanks








  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Must be first

Hi

Insert in the sheet module

Private Sub worksheet_Activate()

Range("A1").Activate

End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Application.EnableEvents = False

If Target.Address = Range("A1").Address Then
Else
If IsEmpty(Cells(1, 1)) Then
MsgBox "you must enter something in A1 before anything else"
Range("A1").Activate
End If
End If

Application.EnableEvents = True

End Sub


So long

Ronnie Coleman a écrit :
I need someone entering information to a worksheet to
enter into a specific cell first. It must be the first
thing they do so is there a way to code a message box
which would pop up to say "you must enter a value in A1
before anywhere else" if they try and enter anywhere else?

Thanks




  #6   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default Must be first

Ronnie,

You may also want to consider an InputBox or a UserForm which would pop up
as the workbook opens and would prompt the user to enter the value, othrwise
close the book.

Regards,
KL

"Ronnie Coleman" wrote in message
...
I need someone entering information to a worksheet to
enter into a specific cell first. It must be the first
thing they do so is there a way to code a message box
which would pop up to say "you must enter a value in A1
before anywhere else" if they try and enter anywhere else?

Thanks






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



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