Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi I have the following code that SHOULD open a file and copy data from range a12:c100 of that opened file into the calling worksheet at sheet1 A38. I get a subscript out of range error trying to activate the newly opened file. I passed the file name to the msgbox and found it has the directory path in it. Since I am on a network is there a way to remove that path so any user at different directories can open the file? Thanks Pal Private Sub CommandButton1_Click() Filename = Application.GetOpenFilename Windows(Filename).Activate Range("A12:C100").Select Selection.Copy Windows("results sheet").Activate Range("A38").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula Bar show the location path file plus the formula | Excel Discussion (Misc queries) | |||
Excel 2007 - File Path location | Excel Discussion (Misc queries) | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
Run Time Error 9 (Subscript out of Range) for XLA file | Excel Discussion (Misc queries) | |||
print file path and location in a footer | New Users to Excel |