Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Entered Info in a Control Text Box to Open other Excel Files

Status
Not open for further replies.

tudor30

Technical User
Jan 7, 2004
49
US
Current Scenario: I'm using drop down boxes to select a product number from the list. The number of items in the list will exceed 100.

Prefereably I would like the user to be able to:
1) Enter the number into a Control Text box
2) When the user clicks a CommandButton the value entered is read and opens the file for that product number.

MY QUESTION: (from a vba novice) I haven't used this type of function and am asking for assistance for coding to complete items 1 & 2?


Sub Reset1()
ActiveSheet.DropDowns("Drop Down 2").Value = 1
ActiveSheet.DropDowns("Drop Down 3").Value = 1
ActiveSheet.DropDowns("Drop Down 4").Value = 1
ActiveSheet.DropDowns("Drop Down 5").Value = 1

Sub MainButtonQA()
If ActiveSheet.DropDowns("Drop Down 2").Value > 1 Then
ChDir "C:\Documents and Settings\rg42735\Desktop"
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\rg42735\Desktop\Copy of ECN 100140D0 Face Page", Origin:= _
xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 1))
ElseIf ActiveSheet.DropDowns("Drop Down 3").Value > 1 Then
ChDir "C:\Documents and Settings\rg42735\Desktop"
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\rg42735\Desktop\Copy of ECN 100150D0 Face Page", Origin:= _
xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 1))
ElseIf ActiveSheet.DropDowns("Drop Down 4").Value > 1 Then
ChDir "C:\Documents and Settings\rg42735\Desktop"
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\rg42735\Desktop\Copy of ECN 100160D0 Face Page", Origin:= _
xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 1))
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top