Copy.Destination and Paste Special

Rusty2712

New Member
Joined
May 23, 2007
Messages
2
Hi, I have the following code but I want to use the Selection.Copy Destination and have it Paste Values as well. At the moment the code copies OK but if I have a formula in one row then it copies the formula, any ideas how I can combine the two.

Sub Combine()
Dim J As Integer

On Error Resume Next
Sheets("Merge").Select
Worksheets("Merge").Range("A2:AB65536").Clear

' copy headings
Sheets("Calanova Golf & Sea All").Activate
Range("A1").EntireRow.Select
Selection.Copy Destination:=Sheets("Merge").Range("A1")

' work through sheets
For J = 2 To 28 ' from sheet 2 to last sheet
Sheets(J).Activate ' make the sheet active
Range("A1").Select
Selection.CurrentRegion.Select ' select all cells in this sheets

' select all lines except title
Selection.Offset(2, 0).Resize(Selection.Rows.Count - 1).Select

' copy cells selected in the new sheet on last line
Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
Next

Worksheets("Datesheet").Select

End Sub
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
This should give you the result you want, and notice there is no need for sheet activation or range selection.

Code:
Worksheets("Merge").Rows(1).Value = Worksheets("Calanova Golf & Sea All").Rows(1).Value
 
Upvote 0
This particular bit would go in place of:

Code:
' copy headings 
Sheets("Calanova Golf & Sea All").Activate 
Range("A1").EntireRow.Select 
Selection.Copy Destination:=Sheets("Merge").Range("A1")
 
Upvote 0

Forum statistics

Threads
1,214,421
Messages
6,119,392
Members
448,891
Latest member
tpierce

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top