Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data inputting question | Excel Worksheet Functions | |||
Inputting data into two worksheets | Excel Discussion (Misc queries) | |||
inputting data | Excel Discussion (Misc queries) | |||
Update a chart immediately after inputting data into data source | Charts and Charting in Excel | |||
Inputting Source Data - help please | Charts and Charting in Excel |