Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox help please
Hi all, i have a range of cells K12:K17 and i need to ask the user for
input (Account Numbers) for each cell from 12 to 17, can i use one inputbox and loop through or must i use 6 different input boxes ?? Bearing in mind the users input might only need to put in a minimuim of two account numbers... Any help would be appreciated... I am not a programmer but a dabbler... Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox help please
try:
Sub myInput() For Each x In Range("K12:K17") x.Value = InputBox("Account ? ") Next End Sub "Les Stout" skrev: Hi all, i have a range of cells K12:K17 and i need to ask the user for input (Account Numbers) for each cell from 12 to 17, can i use one inputbox and loop through or must i use 6 different input boxes ?? Bearing in mind the users input might only need to put in a minimuim of two account numbers... Any help would be appreciated... I am not a programmer but a dabbler... Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox help please
well maby this is better :
Sub myInput() For Each x In Range("K12:K17") x.Interior.ColorIndex = 3 y = InputBox("Account ? ", , , 40, 40) If y < Empty Then x.Value = y x.Interior.ColorIndex = xlNone Next End Sub "excelent" skrev: try: Sub myInput() For Each x In Range("K12:K17") x.Value = InputBox("Account ? ") Next End Sub "Les Stout" skrev: Hi all, i have a range of cells K12:K17 and i need to ask the user for input (Account Numbers) for each cell from 12 to 17, can i use one inputbox and loop through or must i use 6 different input boxes ?? Bearing in mind the users input might only need to put in a minimuim of two account numbers... Any help would be appreciated... I am not a programmer but a dabbler... Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox help please
Thank you excelent for an excellent answer :-)
Just what i was looking for. Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox help please
no problemo :-)
"Les Stout" skrev: Thank you excelent for an excellent answer :-) Just what i was looking for. Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox help please
Here's some interesting code - all you have to do is enter only 1,2,3 or 4 Modify to suit HTH, Jim May Post this into a New Workbook for demonstration purposes Post below into a Standard Module: Sub test() Dim strInput As String Dim arr1 Dim arr2 Dim i As Byte 'Change below line to suit your needs - Also Inputbox Values below arr2 = Array("value 1", "value 2", "value 3", "value 4") strInput = InputBox("Pick up to 4 of the following numbers, separated by comma s:" & _ vbCrLf & vbCrLf & _ "1. value 1" & vbCrLf & _ "2. value 2" & vbCrLf & _ "3. value 3" & vbCrLf & _ "4. value 4" & vbCrLf & vbCrLf & _ "The corresponding values will be placed in cells starting at column A", _ "entering values") If Len(strInput) = 0 Or StrPtr(strInput) = 0 Then Exit Sub End If Range("K12:K17").ClearContents ' I modified this If InStr(1, strInput, ",", vbBinaryCompare) = 0 Then Cells(1) = arr2(Val(Trim(strInput)) - 1) Exit Sub End If arr1 = Split(strInput, ",") For i = 0 To UBound(arr1) Cells(i + 12, 11) = arr2(Val(Trim(arr1(i))) - 1) 'modified Next End Sub "Les Stout" wrote in message : Hi all, i have a range of cells K12:K17 and i need to ask the user for input (Account Numbers) for each cell from 12 to 17, can i use one inputbox and loop through or must i use 6 different input boxes ?? Bearing in mind the users input might only need to put in a minimuim of two account numbers... Any help would be appreciated... I am not a programmer but a dabbler... Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox help please
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
InputBox | Excel Discussion (Misc queries) | |||
inputbox | Excel Discussion (Misc queries) | |||
Inputbox and Application.InputBox | Excel Programming | |||
InputBox | Excel Programming | |||
inputbox | Excel Programming |