#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 337
Default Input box

I have an input box with the following code

quotenumber = InputBox("Please enter QUOTE to recall. If you are recalling a
quote from Server3 then type in \\server3\jobs\estimate1\new_quot1\ and the
quote number", "The Auld Company", "C:\quotes\")

I would like to be able to select the another
path"\\server3\jobs\estimate1\new_quot1\" without having to type it in

oldjay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Input box

Are you trying to open an existing file?

If yes, look at application.getopenfilename in VBA's help:


Dim WkbkName As Variant

WkbkName = Application.GetOpenFilename(filefilter:="Excel files, *.xls")

If WkbkName = False Then
Exit Sub 'user hit cancel
End If

=====
I don't have a network to test this on--you may have to type in the start of the
UNC path to be able to choose deeper levels.

If you map that path to a drive letter, it may be easier to traverse.

Oldjay wrote:

I have an input box with the following code

quotenumber = InputBox("Please enter QUOTE to recall. If you are recalling a
quote from Server3 then type in \\server3\jobs\estimate1\new_quot1\ and the
quote number", "The Auld Company", "C:\quotes\")

I would like to be able to select the another
path"\\server3\jobs\estimate1\new_quot1\" without having to type it in

oldjay


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 337
Default Input box

I can't understand yoyur message

Maybe I can be a little clear
I want an input box (or something) that will give two options
one that will show a path to one folder
and also a path to another folder



"Dave Peterson" wrote:

Are you trying to open an existing file?

If yes, look at application.getopenfilename in VBA's help:


Dim WkbkName As Variant

WkbkName = Application.GetOpenFilename(filefilter:="Excel files, *.xls")

If WkbkName = False Then
Exit Sub 'user hit cancel
End If

=====
I don't have a network to test this on--you may have to type in the start of the
UNC path to be able to choose deeper levels.

If you map that path to a drive letter, it may be easier to traverse.

Oldjay wrote:

I have an input box with the following code

quotenumber = InputBox("Please enter QUOTE to recall. If you are recalling a
quote from Server3 then type in \\server3\jobs\estimate1\new_quot1\ and the
quote number", "The Auld Company", "C:\quotes\")

I would like to be able to select the another
path"\\server3\jobs\estimate1\new_quot1\" without having to type it in

oldjay


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Input box

An inputbox is used to get a value that the user typed in.

I guess you could do something like:

Sub testme()

Dim Folder1 As String
Dim Folder2 As String
Dim resp As String
Dim UseThisOne As String

'your samples weren't different
Folder1 = "\\server3\jobs\estimate1\new_quot1\"
Folder2 = "\\server3\jobs\estimate1\new_quot2\"

UseThisOne = ""
Do
resp = InputBox(Prompt:="1. " & Folder1 & vbLf & _
"2. " & Folder2 & vbLf & _
vbLf & _
"Enter 1 or 2")

Select Case Trim(resp)
Case Is = "1": UseThisOne = Folder1
Case Is = "2": UseThisOne = Folder2
Case Is = "": Exit Do
End Select
If UseThisOne = "" Then
'keep waiting for a valid answer
Else
Exit Do
End If
Loop

If UseThisOne = "" Then
Exit Sub
End If

'show that it worked
MsgBox UseThisOne

End Sub

Oldjay wrote:

I can't understand yoyur message

Maybe I can be a little clear
I want an input box (or something) that will give two options
one that will show a path to one folder
and also a path to another folder

"Dave Peterson" wrote:

Are you trying to open an existing file?

If yes, look at application.getopenfilename in VBA's help:


Dim WkbkName As Variant

WkbkName = Application.GetOpenFilename(filefilter:="Excel files, *.xls")

If WkbkName = False Then
Exit Sub 'user hit cancel
End If

=====
I don't have a network to test this on--you may have to type in the start of the
UNC path to be able to choose deeper levels.

If you map that path to a drive letter, it may be easier to traverse.

Oldjay wrote:

I have an input box with the following code

quotenumber = InputBox("Please enter QUOTE to recall. If you are recalling a
quote from Server3 then type in \\server3\jobs\estimate1\new_quot1\ and the
quote number", "The Auld Company", "C:\quotes\")

I would like to be able to select the another
path"\\server3\jobs\estimate1\new_quot1\" without having to type it in

oldjay


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 337
Default Input box

Dave I get a compile error with Trim highlighted "can't find project or libary

"Dave Peterson" wrote:

An inputbox is used to get a value that the user typed in.

I guess you could do something like:

Sub testme()

Dim Folder1 As String
Dim Folder2 As String
Dim resp As String
Dim UseThisOne As String

'your samples weren't different
Folder1 = "\\server3\jobs\estimate1\new_quot1\"
Folder2 = "\\server3\jobs\estimate1\new_quot2\"

UseThisOne = ""
Do
resp = InputBox(Prompt:="1. " & Folder1 & vbLf & _
"2. " & Folder2 & vbLf & _
vbLf & _
"Enter 1 or 2")

Select Case Trim(resp)
Case Is = "1": UseThisOne = Folder1
Case Is = "2": UseThisOne = Folder2
Case Is = "": Exit Do
End Select
If UseThisOne = "" Then
'keep waiting for a valid answer
Else
Exit Do
End If
Loop

If UseThisOne = "" Then
Exit Sub
End If

'show that it worked
MsgBox UseThisOne

End Sub

Oldjay wrote:

I can't understand yoyur message

Maybe I can be a little clear
I want an input box (or something) that will give two options
one that will show a path to one folder
and also a path to another folder

"Dave Peterson" wrote:

Are you trying to open an existing file?

If yes, look at application.getopenfilename in VBA's help:


Dim WkbkName As Variant

WkbkName = Application.GetOpenFilename(filefilter:="Excel files, *.xls")

If WkbkName = False Then
Exit Sub 'user hit cancel
End If

=====
I don't have a network to test this on--you may have to type in the start of the
UNC path to be able to choose deeper levels.

If you map that path to a drive letter, it may be easier to traverse.

Oldjay wrote:

I have an input box with the following code

quotenumber = InputBox("Please enter QUOTE to recall. If you are recalling a
quote from Server3 then type in \\server3\jobs\estimate1\new_quot1\ and the
quote number", "The Auld Company", "C:\quotes\")

I would like to be able to select the another
path"\\server3\jobs\estimate1\new_quot1\" without having to type it in

oldjay

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Input box

Open excel
Open your workbook
Go into the VBE
Select your project
Tools|References
Look for MISSING reference.

Uncheck that missing reference.

The missing reference may not (usually doesn't) have anything to do with the
line that caused the error.

Oldjay wrote:

Dave I get a compile error with Trim highlighted "can't find project or libary

"Dave Peterson" wrote:

An inputbox is used to get a value that the user typed in.

I guess you could do something like:

Sub testme()

Dim Folder1 As String
Dim Folder2 As String
Dim resp As String
Dim UseThisOne As String

'your samples weren't different
Folder1 = "\\server3\jobs\estimate1\new_quot1\"
Folder2 = "\\server3\jobs\estimate1\new_quot2\"

UseThisOne = ""
Do
resp = InputBox(Prompt:="1. " & Folder1 & vbLf & _
"2. " & Folder2 & vbLf & _
vbLf & _
"Enter 1 or 2")

Select Case Trim(resp)
Case Is = "1": UseThisOne = Folder1
Case Is = "2": UseThisOne = Folder2
Case Is = "": Exit Do
End Select
If UseThisOne = "" Then
'keep waiting for a valid answer
Else
Exit Do
End If
Loop

If UseThisOne = "" Then
Exit Sub
End If

'show that it worked
MsgBox UseThisOne

End Sub

Oldjay wrote:

I can't understand yoyur message

Maybe I can be a little clear
I want an input box (or something) that will give two options
one that will show a path to one folder
and also a path to another folder

"Dave Peterson" wrote:

Are you trying to open an existing file?

If yes, look at application.getopenfilename in VBA's help:


Dim WkbkName As Variant

WkbkName = Application.GetOpenFilename(filefilter:="Excel files, *.xls")

If WkbkName = False Then
Exit Sub 'user hit cancel
End If

=====
I don't have a network to test this on--you may have to type in the start of the
UNC path to be able to choose deeper levels.

If you map that path to a drive letter, it may be easier to traverse.

Oldjay wrote:

I have an input box with the following code

quotenumber = InputBox("Please enter QUOTE to recall. If you are recalling a
quote from Server3 then type in \\server3\jobs\estimate1\new_quot1\ and the
quote number", "The Auld Company", "C:\quotes\")

I would like to be able to select the another
path"\\server3\jobs\estimate1\new_quot1\" without having to type it in

oldjay

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
input box scrolling with barcode reader input cj2k2k Excel Discussion (Misc queries) 0 June 18th 07 07:23 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
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM


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