Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am trying to write a macro that will use one file to update another. I got
some test code to work the way I wanted, but I need to user to select the target file, and that is causing trouble. Here is what I have so far: Option Explicit Sub auto_open() Dim FileName As Variant Application.ScreenUpdating = False FileName =Application.GetOpenFilename(MultiSelect:=False) Workbooks.Open FileName Workbooks(FileName).Worksheets("Sheet1").Unprotect Password:="password" ThisWorkbook.Worksheets("Sheet1").Activate ActiveSheet.Cells.Copy Workbooks(FileName).Worksheets("Sheet1").Range("A1 ").PasteSpecial Workbooks(FileName).Worksheets("Sheet1").Activate ActiveSheet.Range("A1").Select Workbooks(FileName).Worksheets("Sheet1").Protect Password:="password" Application.CutCopyMode = False Application.ScreenUpdating = True ThisWorkbook.Close savechanges:=False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can the author of an .XLS be found and retrieved ? | Excel Discussion (Misc queries) | |||
GetOpenFilename not returning a usable variable | Excel Discussion (Misc queries) | |||
vlookup with more than number to be retrieved | Excel Worksheet Functions | |||
vlookup with more than number to be retrieved | Excel Worksheet Functions | |||
Filter Count of Records Retrieved. | Excel Discussion (Misc queries) |