Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a program to automatically transfer data from an older version to an
updated file The Macro runs from the new file. Right now I have the user enter the old filename and first sheet name by input boxes. This works well but I would like VBA to detect the old file that would be already open and put the name into a variable. The transfer always starts from Sheet1 of the old file no matter what the name of the sheet has been changed to. This works but not what I want: OLDFILENAME = Inputbox("ENTER OLD FILE NAME") FIRSTSHEETNAME = Inputbox("ENTER NAME OF FIRST SHEET IN OLD FILE") Windows(OLDFILENAME).Activate Sheets("FIRSTSHEETNAME").Select This is what I would like <macro to find other open workbook OLDFILENAME = <detected workbook Windows(OLDFILENAME).Activate Sheet1.Select <-- This gives an error msg or Windows(OLDFILENAME).Activate Sheet1.Activate <-- This activates Sheet1 of the new workbook that the macro runs in Thank you in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copying 'sheet1'!A1 to sheet 2, I want to get 'sheet2'A1, not 'she | Excel Discussion (Misc queries) | |||
Selecting chartobject without index no. | Charts and Charting in Excel | |||
transfer data from sheet1 to sheet 2 | Excel Worksheet Functions | |||
Selecting a cell from an index | Excel Programming | |||
selecting a cell in sheet1 | Excel Programming |