Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have to worksheets that have the same layout in two different files... I
want to open one to load the data into the current workbook... I get errors on twbk = thisworkbook Sub loadTickerFile() Dim twbk As Workbook twbk = ThisWorkbook If Worksheets("Long Term Ticket").Range("D2").Value = "" Then MsgBox "Please enter ticker in Range D2 and re-run macro." GoTo ender: End If User = Environ("UserProfile") file = User & "\" & "My Documents\Trade Tickets\Long Term Ticket " & Worksheets("Long Term Ticket").Range("D2").Value Workbooks.Open file Dim wbk As Workbook wbk = ActiveWorkbook twbk.Sheets("Long Term Ticket").Range("e4:e14") = wbk.Sheets("Long Term Ticket").Range("e4:e14") twbk.Sheets("Long Term Ticket").Range("D20:D22") = wbk.Sheets("Long Term Ticket").Range("D20:D22") twbk.Sheets("Long Term Ticket").Range("D28:D37") = wbk.Sheets("Long Term Ticket").Range("D28:D37") twbk.Sheets("Long Term Ticket").Range("D40:D50") = wbk.Sheets("Long Term Ticket").Range("D40:D50") twbk.Sheets("Long Term Ticket").Range("h4:h50") = wbk.Sheets("Long Term Ticket").Range("h4:h50") wbk.Close savechanges:=False ender: Range("A2").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
why do I have to have the source file open to update a database fu | Excel Worksheet Functions | |||
** Links don't update UNLESS source file is open | Links and Linking in Excel | |||
** Links don't update UNLESS source file is open | Links and Linking in Excel | |||
Update Links on file open | Excel Programming | |||
Automate open file, update links, run macro, close and save file | Excel Programming |