Custom form on opening - I think it's an easy one for the experts
To make the form popup
Userform1.Show
The code to populate C4 on clicking OK is
Private Sub cmdOK_Click()
Worksheets("Sheet1").Range("C4").Value = Textbox1.Text
End Sub
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"David" wrote in message
...
Hi,
I know excel and macros, but unfortunately I'm not so
good with VBA. Can anyone tell me the code to do the
following:
I would like to create a custom form that asks: "Please
enter firm name" The user would then write in the name
i.e. firm A and press ok. What ever is written in that
text box would be populated in field c4 and they could
fill in the rest of the worksheet.
I can make the control and form just fine, but I don't
know how to do the code to make that form pop up on start
up, populate field c4 and then go away once the user
enters the info and press ok.
Also I will be emailing it to several different parties.
Is there away to make the code go into the workseet and
not in something like my personal.xls where I put my
macros?
Your help would be greatly appreciated.
Thanks,
David
|