![]() |
Pop up window prompt for name/address upon opening of file
I have an order form that I have created on an Excel spreadsheet and
would like to insert some code that would have a window pop up to prompt the user for their name, address and voicemail box #. I would like the pop up to occur each time the document is opened. I am not very familiar with VB but I found this code (see below- I already modified it for my document- cell reference, and text) but don't know where to put it in the script and how to set it up so that it runs each time the form gets opened. Also not sure as to where to put the < symbols. Sub getvalue() Range("B3").Value = InputBox("Enter your Name") Next Range("D3").Value = InputBox("Enter your Shipping Address") Next Range("H3").Value = InputBox("Enter your Voicemail Box #") End Sub Additionally, if my Excel document already contains some data validation lists will that create a problem and if so whats the best way to fix it. My knowledge on VB is pretty lacking...Any help would be greatly appreciated! |
Pop up window prompt for name/address upon opening of file
Put this code in the ThisWorkbook page. Should do what you're looking
for. I would suggest you look into user forms for getting all 3 values on one popup box (see http://j-walk.com/ss/excel/tips/userformtips.htm for help). Sub getvalue() Range("B3").Value = InputBox("Enter your Name") Range("D3").Value = InputBox("Enter your Shipping Address") Range("H3").Value = InputBox("Enter your Voicemail Box #") End Sub Private Sub Workbook_Open() Call getvalue End Sub HRgal wrote: I have an order form that I have created on an Excel spreadsheet and would like to insert some code that would have a window pop up to prompt the user for their name, address and voicemail box #. I would like the pop up to occur each time the document is opened. I am not very familiar with VB but I found this code (see below- I already modified it for my document- cell reference, and text) but don't know where to put it in the script and how to set it up so that it runs each time the form gets opened. Also not sure as to where to put the < symbols. Sub getvalue() Range("B3").Value = InputBox("Enter your Name") Next Range("D3").Value = InputBox("Enter your Shipping Address") Next Range("H3").Value = InputBox("Enter your Voicemail Box #") End Sub Additionally, if my Excel document already contains some data validation lists will that create a problem and if so whats the best way to fix it. My knowledge on VB is pretty lacking...Any help would be greatly appreciated! |
Pop up window prompt for name/address upon opening of file
So I have put the information into a user form...do I still need to
utilize the code then? Sorry, this is all very foreign to me...but I guess the only way to learn is to try it! Where is the This Workbook page? John Fuller wrote: Put this code in the ThisWorkbook page. Should do what you're looking for. I would suggest you look into user forms for getting all 3 values on one popup box (see http://j-walk.com/ss/excel/tips/userformtips.htm for help). Sub getvalue() Range("B3").Value = InputBox("Enter your Name") Range("D3").Value = InputBox("Enter your Shipping Address") Range("H3").Value = InputBox("Enter your Voicemail Box #") End Sub Private Sub Workbook_Open() Call getvalue End Sub HRgal wrote: I have an order form that I have created on an Excel spreadsheet and would like to insert some code that would have a window pop up to prompt the user for their name, address and voicemail box #. I would like the pop up to occur each time the document is opened. I am not very familiar with VB but I found this code (see below- I already modified it for my document- cell reference, and text) but don't know where to put it in the script and how to set it up so that it runs each time the form gets opened. Also not sure as to where to put the < symbols. Sub getvalue() Range("B3").Value = InputBox("Enter your Name") Next Range("D3").Value = InputBox("Enter your Shipping Address") Next Range("H3").Value = InputBox("Enter your Voicemail Box #") End Sub Additionally, if my Excel document already contains some data validation lists will that create a problem and if so whats the best way to fix it. My knowledge on VB is pretty lacking...Any help would be greatly appreciated! |
All times are GMT +1. The time now is 05:34 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com