View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_576_] Simon Lloyd[_576_] is offline
external usenet poster
 
Posts: 1
Default inputbox function


It was a simple mistake you made.....try this....

Public Sub AddNames()

Dim FirstName As String
FirstName = InputBox("What is your firstname?", "First Name")
ActiveWorkbook.Worksheets("sheet1").Range("B2").Va lue = FirstName

End Sub

Note i have removed the " from both ends and the = as formulae o
answers to arguments have =, you have already declared Firstname.

Hope this helps.

Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=26637