Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default InputBox help please

Thanks for the input JMay

Les Stout

*** Sent via Developersdex http://www.developersdex.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
InputBox GeorgeJ Excel Discussion (Misc queries) 5 July 12th 07 01:20 AM
inputbox brownti via OfficeKB.com Excel Discussion (Misc queries) 2 February 9th 07 02:37 PM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM
InputBox banavas[_6_] Excel Programming 1 June 11th 04 12:49 PM
inputbox defj Excel Programming 4 November 26th 03 10:25 PM


All times are GMT +1. The time now is 03:22 PM.

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"