Thread: Pop Up Forms
View Single Post
  #3   Report Post  
TBD
 
Posts: n/a
Default

Hi Julie,

Sorry, but I think I'm trying to confuse matters. Basically, I have a macro
that contains a number of input boxes. I would like a text information box
to display itself before these Input boxes.

I know this shouldn't be difficult but I've copied the macro and I'm not
particularly great with Excel Visual Basic!

Thanks in advance for any help you can give! My macro is below:

' Macro written by Tom Hannah on 27th January 2005
' All notes appear in green
'************************************************* **************************
'Specify Visual Basic Options
Option Explicit 'must declare all variable
Option Compare Text 'Not case sensitive
Option Base 1 'declare lower bound of array to 1
'_________________________________________________ ______
'Defining Varianble
Dim names As String
Dim emp As String
Dim cost As String
Dim ord As String
'_________________________________________________ ____
'Declare Property
Property Get pMyPath()
pMyPath = ThisWorkbook.Path 'define path of this module
End Property

'************************************************* *******************************

Sub tomsmacro()
Sheets("Form").Select
Range("b3").Select
names = InputBox("Please enter your name", "Employee Name",
Range("b3").Value)
ActiveCell.Value = names
Range("b6").Select
emp = InputBox("Please enter Vehicle(s) Booked", "Vehicle",
Range("b6").Value)
ActiveCell.Value = emp
Range("b9").Select
cost = InputBox("Please enter the dates of Vehicle Booking", "Dates",
Range("b9").Value)
ActiveCell.Value = cost
Range("b12").Select
ord = InputBox("Please enter your specific prep requests (if any)",
"Prep Requests", Range("b12").Value)
ActiveCell.Value = ord
End Sub



"JulieD" wrote:

Hi

not sure what you mean by 'created a form' - do you mean you've edited a
worksheet to look like a form or you've created a userform in the VBE window
(insert / userform)

secondly, not sure what you mean by you've saved it as a template in your
templates folder ....

if you want the "form" to appear when you open a specific workbook why don't
you (if it's a worksheet looking like a form) insert it into the workbook
and code the Workbook_Open code to always go to that sheet. If it's a
userform, i'm not sure how you can save it as a template as it is a VBE
object which lives within VBE. Assuming however, that it is in the workbook
that you want it to display in, you can code the following in the
Workbook_Open event -
userform1.show

Hope this helps
Cheers
JulieD

"TBD" wrote in message
...
Hi all,

I have created a form and saved it as a template in my templates folder.
However, I want to have this form automatically "pop-up" when I open the
specific Excel spreadsheet.

Its relatively easy doing this in Access, so I'm presuming Excel can't be
whole lot more difficult??? The form is nothing more complicated then a
text
box, giving some basic instructions on entering data into the spreadsheet
for
users.

Any help you could give would be much appreciated!!

TBD