Hi there,
Need help again! Basically I have the code,
If Range("E137").Value = "1" Then Range("A56:L73").Select Selection.Copy Workbooks.Open(Sheet2.TextBox1.Value).Activate Range("A56").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End If
A workbook will open when I activate this macro. In order for the workbook to be open, the user will need to type in the workbook file name and the folders it is stored in the ActiveX text box. E.g,
The user will need to type in C:\Documents and Settings\Test\Desktop\Test Folder\Test File
What I want is for the user to just type in the file name which is Test File. Note that the place where the file is stored is fixed. Is it possible?
Please help, thanks!
Using WinXP and Excel 2007.
The parameter in Workbooks.Open is a string (text). Hence, you can do something like...
Dim strPath as StringstrPath = "C:\Documents and Settings\Test\Desktop\Test Folder\" strPath = strPath & Sheet2.TextBox1.Value Workbooks.Open(strPath).Activate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks