Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inputting data through a VBA input box

I'm learning VBA, but it's slow going and I'm struggling with some areas
which I'm sure should be simple.....

I want to run a macro that brings up a simple input box. The user
enters an 8 digit number and then clicks on OK. I want this number to
be placed in a specific cell in my workbook. How can I achieve this
please?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Inputting data through a VBA input box

Chris, use something like this
Sub Number()
MyNum = InputBox("Enter Discount Amount", "Discount Amount")
If MyNum = "" Then
Exit Sub
End If
Range("B6").Value = MyNum
End Sub

--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **

"Big Chris" wrote in message
...
I'm learning VBA, but it's slow going and I'm struggling with some areas
which I'm sure should be simple.....

I want to run a macro that brings up a simple input box. The user
enters an 8 digit number and then clicks on OK. I want this number to
be placed in a specific cell in my workbook. How can I achieve this
please?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inputting data through a VBA input box

Something like this:

Dim X As Variant
X = InputBox("enter something")
If X < "" Then Cells(1, 1) = X

tom @ the domain below
www.tomchester.net


"Big Chris" wrote in message
...
I'm learning VBA, but it's slow going and I'm struggling with some areas
which I'm sure should be simple.....

I want to run a macro that brings up a simple input box. The user
enters an 8 digit number and then clicks on OK. I want this number to
be placed in a specific cell in my workbook. How can I achieve this
please?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Inputting data through a VBA input box

Forgot to take the titles out of the example

Sub Number()
MyNum = InputBox("Enter Your Number", "Title here")
If MyNum = "" Then
Exit Sub
End If
Range("B6").Value = MyNum
End Sub



"Paul B" wrote in message
...
Chris, use something like this
Sub Number()
MyNum = InputBox("Enter Discount Amount", "Discount Amount")
If MyNum = "" Then
Exit Sub
End If
Range("B6").Value = MyNum
End Sub

--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **

"Big Chris" wrote in message
...
I'm learning VBA, but it's slow going and I'm struggling with some areas
which I'm sure should be simple.....

I want to run a macro that brings up a simple input box. The user
enters an 8 digit number and then clicks on OK. I want this number to
be placed in a specific cell in my workbook. How can I achieve this
please?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inputting data through a VBA input box

Thanks for your help. Much appreciated....I'll be back!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
Data inputting question sha2312 Excel Worksheet Functions 2 January 17th 08 05:48 AM
Inputting data into two worksheets 4762nicho Excel Discussion (Misc queries) 3 April 28th 07 12:54 PM
inputting data Shanor Excel Discussion (Misc queries) 0 June 15th 06 10:50 AM
Update a chart immediately after inputting data into data source MELMEL Charts and Charting in Excel 1 December 1st 05 09:34 PM
Inputting Source Data - help please foredis Charts and Charting in Excel 1 June 22nd 05 02:36 PM


All times are GMT +1. The time now is 11:57 AM.

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

About Us

"It's about Microsoft Excel"