Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Need help with input box

Alright, I have code that will have the user insert a Contract # into a
specific cell. This works fine. But what I would like to know, is it possible
to have the inputbox message to already have the Cells Value Listed, then the
user would insert the new information only if neccessary. For Example:

Cell A1 would have the contract # "123" already listed. The inputbox would
ask the user "Please Enter Contract # or if this is the Correct # then press
OK". But in the area where the user enters the information, the "123" would
already be listed. Can this be done with a Inputbox? I hope this makes sense.
Any help is appreciated. Here is the code that I have.

Dim ans As Variant
ans = InputBox("Please Enter Contract # or if this is the Correct # then
press OK")
With Worksheets("Agreement")
Cells(8, 12) = (ans)
End With


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Need help with input box

One way:

Dim ans As Variant
Do
ans = Application.InputBox( _
Prompt:="Please Enter Contract #", _
Default:=Sheets("Agreement").Range("A1").Value, _
Title:="Contract Number", _
Type:=2)
If ans = False Then Exit Sub 'User cancelled
Loop Until Len(ans) 0


In article ,
"Brad" wrote:

Alright, I have code that will have the user insert a Contract # into a
specific cell. This works fine. But what I would like to know, is it possible
to have the inputbox message to already have the Cells Value Listed, then the
user would insert the new information only if neccessary. For Example:

Cell A1 would have the contract # "123" already listed. The inputbox would
ask the user "Please Enter Contract # or if this is the Correct # then press
OK". But in the area where the user enters the information, the "123" would
already be listed. Can this be done with a Inputbox? I hope this makes sense.
Any help is appreciated. Here is the code that I have.

Dim ans As Variant
ans = InputBox("Please Enter Contract # or if this is the Correct # then
press OK")
With Worksheets("Agreement")
Cells(8, 12) = (ans)
End With

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Need help with input box

Hi Brad

yes, basically the third parameter of the inputbox is a default answer

so you can do something like this:

Sheets("Agreement").Cells(8, 12).Value = InputBox("Please Enter Contract #
or if this is the Correct # then press OK", , Sheets("Agreement").Cells(8,
12).Value)


(all on one line)

Cheers
julieD



"Brad" wrote in message
...
Alright, I have code that will have the user insert a Contract # into a
specific cell. This works fine. But what I would like to know, is it
possible
to have the inputbox message to already have the Cells Value Listed, then
the
user would insert the new information only if neccessary. For Example:

Cell A1 would have the contract # "123" already listed. The inputbox would
ask the user "Please Enter Contract # or if this is the Correct # then
press
OK". But in the area where the user enters the information, the "123"
would
already be listed. Can this be done with a Inputbox? I hope this makes
sense.
Any help is appreciated. Here is the code that I have.

Dim ans As Variant
ans = InputBox("Please Enter Contract # or if this is the Correct #
then
press OK")
With Worksheets("Agreement")
Cells(8, 12) = (ans)
End With




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Need help with input box

Brad, do you want the valve in the active cell in the input box? if so try
this

ans = InputBox("Please Enter Contract # or if this is the Correct # then
press OK", , ActiveCell)

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Brad" wrote in message
...
Alright, I have code that will have the user insert a Contract # into a
specific cell. This works fine. But what I would like to know, is it
possible
to have the inputbox message to already have the Cells Value Listed, then
the
user would insert the new information only if neccessary. For Example:

Cell A1 would have the contract # "123" already listed. The inputbox would
ask the user "Please Enter Contract # or if this is the Correct # then
press
OK". But in the area where the user enters the information, the "123"
would
already be listed. Can this be done with a Inputbox? I hope this makes
sense.
Any help is appreciated. Here is the code that I have.

Dim ans As Variant
ans = InputBox("Please Enter Contract # or if this is the Correct #
then
press OK")
With Worksheets("Agreement")
Cells(8, 12) = (ans)
End With




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
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 10:01 PM.

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

About Us

"It's about Microsoft Excel"