Anne Troy
MrExcel MVP
- Joined
- Feb 18, 2002
- Messages
- 2,632
- Office Version
- 365
- Platform
- Windows
I'm pretty sure it's completely wrong, but here's what I've got:
Those are the 4 named ranges I want to copy from wcs3.xlsm to oaapp.xlsm. The named ranges are the same in both workbooks. I copied someone's code, and began to alter it, but stalled on how to do the paste range. Theirs was, of course, a:d. I don't want the user to have to select any cells to get the data over.
Thanks tons for any help you can provide!
Code:
Sub CopyToOAApp()
End Sub
Dim wbk As Workbook
Dim strFirstFile As String
Dim strSecondFile As String
strFirstFile = "wcs3.xlsm"
strSecondFile = "oaapp.xlsm"
Set wbk = Workbooks(strFirstFile)
With wbk.Sheets("Dashboard")
.Range("merchfirstname").Copy
.Range("merchconame").Copy
.Range("merchemail").Copy
.Range("repemail").Copy
End With
Set wbk = Workbooks.Open(strSecondFile)
With wbk.Sheets("Dashboard")
.Range("a:d").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End With
End Sub
Those are the 4 named ranges I want to copy from wcs3.xlsm to oaapp.xlsm. The named ranges are the same in both workbooks. I copied someone's code, and began to alter it, but stalled on how to do the paste range. Theirs was, of course, a:d. I don't want the user to have to select any cells to get the data over.
Thanks tons for any help you can provide!