Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get filename
i use getopenfilename to get a excel file and open it, and copy certain
range within 2 files. my problem is i don't know how to switch within 2 windows. i try to use workbook(filename).activate, but the filename variable include the path as well. regards |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get filename
One way:
Dim wbBook1 As Workbook Dim wbBook2 As Workbook Dim vFileName As Variant Set wbBook1 = ActiveWorkbook vFileName = Application.GetOpenFilename If vFileName = False Then Exit Sub Set wbBook2 = Workbooks.Open(Filename:=vFileName) Then use wbBook2.Activate and wbBook1.Activate to switch. In article , "Tang" wrote: i use getopenfilename to get a excel file and open it, and copy certain range within 2 files. my problem is i don't know how to switch within 2 windows. i try to use workbook(filename).activate, but the filename variable include the path as well. regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
filename.xls:1 and filename.xls:2 | Excel Discussion (Misc queries) | |||
Cell("filename") doesn't update to new filename when do save as. | Excel Worksheet Functions | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
Saving filename same as import filename | Excel Programming | |||
how to specify the filename | Excel Programming |