S
StonyfieldRob
Trying to copy a specific range on a worksheet to another workbook. The
source workbook is not always named the same so need it to be a bit generic
like the code below. The only catch is I need to paste values only and no
formulas.
Sub CopyData()
'need online help to paste special
Dim SourceWB As Workbook
Dim DestinationWB As Workbook
Dim DestinationWS As Worksheet
Set SourceWB = Workbooks.Open("\\Wuslonfs03\share\product\Demand
Planning\DPDatabases\AbyA.xls")
Set DestinationWB = ThisWorkbook
With SourceWB
Set DestinationWS = DestinationWB.Worksheets("Any by Any")
With .Worksheets("Any by Any")
.Range("A1:AC65536").Copy
End With
End With
End Sub
source workbook is not always named the same so need it to be a bit generic
like the code below. The only catch is I need to paste values only and no
formulas.
Sub CopyData()
'need online help to paste special
Dim SourceWB As Workbook
Dim DestinationWB As Workbook
Dim DestinationWS As Worksheet
Set SourceWB = Workbooks.Open("\\Wuslonfs03\share\product\Demand
Planning\DPDatabases\AbyA.xls")
Set DestinationWB = ThisWorkbook
With SourceWB
Set DestinationWS = DestinationWB.Worksheets("Any by Any")
With .Worksheets("Any by Any")
.Range("A1:AC65536").Copy
End With
End With
End Sub