Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy/pasting between 2 workbooks...
Hi there,
Thank you very much for the very quick reply. I probably should have let you know that I also had the worksheets named. Down below your example is my feeble attempt using the VBA recorder to show you what I was trying to accomplish. My code works fine until I save the two workbooks out to differently named workbooks. Again, thanks for your input. Joe. Dim sFile As String sFile = Format(Date, "dddmmddyy") Workbooks("Tracking-" & sFile).Worksheets(1).Range("A1:A100").CopyWorkbook s("CallResults-" & sFile).Worksheets(1).Range("a1:a100").PasteSpecial Paste:=xlValues ' Original Problem. ' The code below works fine............until..........I copy the workbooks to a new name. ' Example: ' SourceFile.xls is saved out to SourceFileCopiedOnce.xls ' and ' DestinationFile.xls is saved out to DestinationFileCopiedOnce.xls. ' I understand that I've hardcoded the original workbook names in the code below and that those references ' don't update respectively when doing a "Save As" to a different named workbook. ' Range("A1").Select ' ActiveCell.FormulaR1C1 = "Start here" ' Range("B4:B13").Select ' Selection.Copy ' Windows("DestinationFile.xls").Activate ' Range("B4").Select ' Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ ' False, Transpose:=False ' Range("A1").Select ' Windows("SourceFile.xls").Activate ' Range("A2").Select ' Application.CutCopyMode = False ' ActiveCell.FormulaR1C1 = "Stop here" ' Range("A3").Select End Sub *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro for copy-pasting from different workbooks | Excel Worksheet Functions | |||
Pasting a formula in many different workbooks | Excel Discussion (Misc queries) | |||
Copying and Pasting between Workbooks | Excel Worksheet Functions | |||
Copying and Pasting between Workbooks | Excel Worksheet Functions | |||
Copy/pasting between 2 workbooks... | Excel Programming |