View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default using a input box

Hi Ned,

Here's the code I have so far, but it's not working. I can get it to work
if I run it manually within excel.


Where did you put the code?

It should be in the workbook's ThisWorbook module. You can access this
module by right-clicking the Excel icon at the extreme left of the Menu
toolbar and selecting View Code.

Your code worked for me, providing that it was housed in the correct module.

--
Regards,
Norman



"ned" wrote in message
...
what if I want a input box to pop up when I open up a certain workbook.
Here's the code I have so far, but it's not working. I can get it to work
if I run it manually within excel.

Private Sub WorkbookOpen()
Dim strname As String
strname = InputBox("Please type in your name.", "Name")
MsgBox ("Hey " & strname & "! " & "Fill in the yellow cells only")
End Sub


"kkknie" wrote in message
...

Add this to your code:

Dim strName As String
strName = InputBox("Please enter your name.", "Name")

'
' -- Uncomment and use whichever footers you wish
'
'ActiveSheet.PageSetup.LeftFooter = ""
ActiveSheet.PageSetup.CenterFooter = strName & " " & Now
'ActiveSheet.PageSetup.RightFooter = ""

'Add your code to print here

K


--
kkknie
------------------------------------------------------------------------
kkknie's Profile:

http://www.excelforum.com/member.php...fo&userid=7543
View this thread:
http://www.excelforum.com/showthread...hreadid=266614