Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default XL 2003 - Create Dialog Box to Complete Cells...

I have an expense spreadsheet containing two sheets (car mileage & other
expenses). Ideally, when a user opens the template, I'd like them to see a
dialog box asking for Name (say, cell C4), Payroll Number (cell G4) and Date
(cell N4). When they complete the dialog box and click on OK, the cells are
populated and the corresponding cells on the second sheet are also completed
(which I know are just formulae referring to the cells on the first sheet).
Any help gratefully accepted.

TIA
Amanda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default XL 2003 - Create Dialog Box to Complete Cells...

How about a series of Input boxes whenever sheet1 is activated, but the
boxes only appear if the data is missing? Right-click on the sheet tab,
select view code and paste this the

Private Sub Worksheet_Activate()
If Range("C4").Value = "" Then
Range("C4").Value = InputBox("Enter your Name")
End If
If Range("G4").Value = "" Then
Range("G4").Value = InputBox("Enter your Payroll Number")
End If
If Range("N4").Value = "" Then
Range("N4").Value = InputBox("Enter Date")
End If
End Sub

Mike F
"Birmangirl" wrote in message
...
I have an expense spreadsheet containing two sheets (car mileage & other
expenses). Ideally, when a user opens the template, I'd like them to see a
dialog box asking for Name (say, cell C4), Payroll Number (cell G4) and
Date
(cell N4). When they complete the dialog box and click on OK, the cells
are
populated and the corresponding cells on the second sheet are also
completed
(which I know are just formulae referring to the cells on the first
sheet).
Any help gratefully accepted.

TIA
Amanda



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default XL 2003 - Create Dialog Box to Complete Cells...

Hi Mike & thanks for your very prompt response. This is practically perfect,
except that I can only currently get the input boxes to appear if I click on
Run in the VB window. My macro security is currently set to low.
I'm sure I'm doing something (probably very simple) wrong or missed
something out - any suggestions?
TIA
Amanda

"Mike Fogleman" wrote:

How about a series of Input boxes whenever sheet1 is activated, but the
boxes only appear if the data is missing? Right-click on the sheet tab,
select view code and paste this the

Private Sub Worksheet_Activate()
If Range("C4").Value = "" Then
Range("C4").Value = InputBox("Enter your Name")
End If
If Range("G4").Value = "" Then
Range("G4").Value = InputBox("Enter your Payroll Number")
End If
If Range("N4").Value = "" Then
Range("N4").Value = InputBox("Enter Date")
End If
End Sub

Mike F
"Birmangirl" wrote in message
...
I have an expense spreadsheet containing two sheets (car mileage & other
expenses). Ideally, when a user opens the template, I'd like them to see a
dialog box asking for Name (say, cell C4), Payroll Number (cell G4) and
Date
(cell N4). When they complete the dialog box and click on OK, the cells
are
populated and the corresponding cells on the second sheet are also
completed
(which I know are just formulae referring to the cells on the first
sheet).
Any help gratefully accepted.

TIA
Amanda




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default XL 2003 - Create Dialog Box to Complete Cells...

You are right. Opening a workbook does not trigger the WorksheetActivate
event. It would only work as you said, or you went to another sheet and then
back to sheet1. So, lets move the code to the ThisWorkbook code module and
delete what you have now:

Private Sub Workbook_Open()
If Range("C4").Value = "" Then
Range("C4").Value = InputBox("Enter your Name")
End If
If Range("G4").Value = "" Then
Range("G4").Value = InputBox("Enter your Payroll Number")
End If
If Range("N4").Value = "" Then
Range("N4").Value = InputBox("Enter Date")
End If
End Sub


Mike F
Birmangirl wrote in message
...
Hi Mike & thanks for your very prompt response. This is practically

perfect,
except that I can only currently get the input boxes to appear if I click

on
Run in the VB window. My macro security is currently set to low.
I'm sure I'm doing something (probably very simple) wrong or missed
something out - any suggestions?
TIA
Amanda

"Mike Fogleman" wrote:

How about a series of Input boxes whenever sheet1 is activated, but the
boxes only appear if the data is missing? Right-click on the sheet tab,
select view code and paste this the

Private Sub Worksheet_Activate()
If Range("C4").Value = "" Then
Range("C4").Value = InputBox("Enter your Name")
End If
If Range("G4").Value = "" Then
Range("G4").Value = InputBox("Enter your Payroll Number")
End If
If Range("N4").Value = "" Then
Range("N4").Value = InputBox("Enter Date")
End If
End Sub

Mike F
"Birmangirl" wrote in message
...
I have an expense spreadsheet containing two sheets (car mileage &

other
expenses). Ideally, when a user opens the template, I'd like them to

see a
dialog box asking for Name (say, cell C4), Payroll Number (cell G4)

and
Date
(cell N4). When they complete the dialog box and click on OK, the

cells
are
populated and the corresponding cells on the second sheet are also
completed
(which I know are just formulae referring to the cells on the first
sheet).
Any help gratefully accepted.

TIA
Amanda






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 to create a complete list of combinations from 5 options Nevermore Excel Discussion (Misc queries) 6 July 5th 09 04:04 PM
Where can I find a free trial of excel and access 2003 complete? Millie Excel Discussion (Misc queries) 1 December 5th 07 03:50 PM
How do I create a conditional formula that hides a complete row o. Tom Excel Worksheet Functions 3 March 28th 06 12:46 PM
create an automatic complete list from existing data in the sheet Etienne Excel Discussion (Misc queries) 2 February 8th 06 01:55 PM
Create (or find) a complete object tree for excel Alan Excel Programming 6 February 11th 04 09:34 PM


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