Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default inputbox function


Hi,

I am really new to VBA programming and was seeking some help and thi
seems like a great place to do it.

Here is the code that i have at the moment:


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


My aim is to get an input box to prompt a user to input their firs
name and after the user does so, excel will input the user's name int
the particular cell. I think my problem is what i've underline
("=FirstName")... i don't know what i should put after the value to ge
it to do what i need it to do. Maybe i've made other mistakes too?

Any help would be great. Thanks

--
nhan
-----------------------------------------------------------------------
nhanh's Profile: http://www.excelforum.com/member.php...fo&userid=1501
View this thread: http://www.excelforum.com/showthread.php?threadid=26637

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default inputbox function

Hi
use
activesheet.range("A1").value=firstname

--
Regards
Frank Kabel
Frankfurt, Germany

"nhanh" schrieb im Newsbeitrag
...

Hi,

I am really new to VBA programming and was seeking some help and this
seems like a great place to do it.

Here is the code that i have at the moment:


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


My aim is to get an input box to prompt a user to input their first
name and after the user does so, excel will input the user's name

into
the particular cell. I think my problem is what i've underlined
("=FirstName")... i don't know what i should put after the value to

get
it to do what i need it to do. Maybe i've made other mistakes too?

Any help would be great. Thanks!


--
nhanh
---------------------------------------------------------------------

---
nhanh's Profile:

http://www.excelforum.com/member.php...o&userid=15019
View this thread:

http://www.excelforum.com/showthread...hreadid=266371


  #3   Report Post  
Posted to microsoft.public.excel.programming
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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default inputbox function

Try:
Worksheets("sheet1").Range("B2").Value = FirstName


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"nhanh" wrote in message
...

Hi,

I am really new to VBA programming and was seeking some help and this
seems like a great place to do it.

Here is the code that i have at the moment:


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


My aim is to get an input box to prompt a user to input their first
name and after the user does so, excel will input the user's name into
the particular cell. I think my problem is what i've underlined
("=FirstName")... i don't know what i should put after the value to get
it to do what i need it to do. Maybe i've made other mistakes too?

Any help would be great. Thanks!


--
nhanh
------------------------------------------------------------------------
nhanh's Profile:
http://www.excelforum.com/member.php...o&userid=15019
View this thread: http://www.excelforum.com/showthread...hreadid=266371



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default inputbox function

Public Sub AddNames()

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

End Sub

--

HTH

RP

"nhanh" wrote in message
...

Hi,

I am really new to VBA programming and was seeking some help and this
seems like a great place to do it.

Here is the code that i have at the moment:


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


My aim is to get an input box to prompt a user to input their first
name and after the user does so, excel will input the user's name into
the particular cell. I think my problem is what i've underlined
("=FirstName")... i don't know what i should put after the value to get
it to do what i need it to do. Maybe i've made other mistakes too?

Any help would be great. Thanks!


--
nhanh
------------------------------------------------------------------------
nhanh's Profile:

http://www.excelforum.com/member.php...o&userid=15019
View this thread: http://www.excelforum.com/showthread...hreadid=266371





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default inputbox function


Nice Bob!,

Wish i had thought of the lines you added.......Do.....loop unti
FirstName < ""


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
InputBox Function & Cancel Otto Moehrbach[_6_] Excel Programming 4 September 30th 04 01:13 AM
InputBox function - prompt string limit Marcotte A[_2_] Excel Programming 4 June 9th 04 09:47 AM
InputBox Function Alex[_13_] Excel Programming 1 April 8th 04 05:10 PM
Mask an entry using InputBox function Vasco[_2_] Excel Programming 3 July 23rd 03 12:45 PM
Help with Inputbox Function Eric[_7_] Excel Programming 4 July 14th 03 08:00 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"