Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Help needed with Inputbox problem

Hi Les,

Try something like:

'=============
Public Sub Tester005()
Dim x As Range
Dim myVal As Variant

For Each x In Range("H12:H18")
x.Value = InputBox( _
"Please enter the Account number..." _
& vbCrLf & vbCrLf & _
"To end input, enter nothing", _
"ACCOUNT NUMBER")
If x.Value = "" Then
Exit Sub
Else

myVal = InputBox(Prompt:="Insert A/C value", _
Title:="A/C Value")

If IsNumeric(myVal) Then
x.Offset(0, 2).Value = CDbl(myVal)
End If
End If

Next x
End Sub
'<<=============


---
Regards,
Norman




"Les Stout" wrote in message
...
Hi all, i have the following code that is working fine, i just need to
add another range and input within the loop.
After the "Account Number" i to put in the value for the account in the
Range("K12:K18"), can i include it in this loop or must i do a different
one ??


For Each x In Range("H12:H18")
x.Value = InputBox("Please enter the Account number..." & vbCrLf &
vbCrLf & _
"To end input, enter nothing", "ACCOUNT NUMBER")
If x.Value = "" Then Exit Sub
Next


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Help needed with Inputbox problem

A possible slight correction -

? Range("H12").Offset(0,2).Address
$J$12


I think Norman meant

x.Offset(0, 3).Value = CDbl(myVal)

if you want the values in column K as you stated.

--
Regards,
Tom Ogilvy



"Norman Jones" wrote:

Hi Les,

Try something like:

'=============
Public Sub Tester005()
Dim x As Range
Dim myVal As Variant

For Each x In Range("H12:H18")
x.Value = InputBox( _
"Please enter the Account number..." _
& vbCrLf & vbCrLf & _
"To end input, enter nothing", _
"ACCOUNT NUMBER")
If x.Value = "" Then
Exit Sub
Else

myVal = InputBox(Prompt:="Insert A/C value", _
Title:="A/C Value")

If IsNumeric(myVal) Then
x.Offset(0, 2).Value = CDbl(myVal)
End If
End If

Next x
End Sub
'<<=============


---
Regards,
Norman




"Les Stout" wrote in message
...
Hi all, i have the following code that is working fine, i just need to
add another range and input within the loop.
After the "Account Number" i to put in the value for the account in the
Range("K12:K18"), can i include it in this loop or must i do a different
one ??


For Each x In Range("H12:H18")
x.Value = InputBox("Please enter the Account number..." & vbCrLf &
vbCrLf & _
"To end input, enter nothing", "ACCOUNT NUMBER")
If x.Value = "" Then Exit Sub
Next


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Help needed with Inputbox problem

Hi Tom,

'--------------
I think Norman meant

x.Offset(0, 3).Value = CDbl(myVal)
if you want the values in column K as you stated.

'--------------

Thank you, Tom!


---
Regards,
Norman


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help needed with Inputbox problem

Thanks so much for the replies, much appreciated...

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/Regression Problem Matt[_36_] Excel Programming 2 February 20th 06 08:15 PM
Inputbox/Regression Problem MattB[_3_] Excel Programming 0 February 17th 06 06:29 PM
Problem with focusing on Application.Inputbox type:= 8 masayoshi hayashi Excel Programming 0 September 16th 04 10:15 AM
Inputbox for Worksheet name - problem Stuart[_5_] Excel Programming 3 February 13th 04 07:02 PM
InputBox Method Logic Problem ExcelMonkey[_20_] Excel Programming 2 January 24th 04 04:47 AM


All times are GMT +1. The time now is 06:54 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"