Paste special formatting issues

Macro_

New Member
Joined
Sep 3, 2014
Messages
35
Hi all,
I have a macro which copies data from one sheet (including tables, figures etc) and paste specials - values and formatting only - to another worksheet. The only issue is that cells which are highlighted in the first workbook are not getting copied to the exactly relevant cells in the new workbook but to one cell below.. I've tried two different codes with the same result. The codes I have used are listed below. Any ideas? Thanks any advance for any help..
ActiveCell.Offset(1, 0).Range("A1:S84").Copy
ActiveCell.Offset(1, 0).Range("A1:S84").PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(1, 0).Range("A1:S84").PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False

AND

ActiveCell.Offset(1, 0).Range("A1:S84").Copy
ActiveCell.Offset(1, 0).Range("A1:S84").PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(1, 0).Range("A1:S84").PasteSpecial Paste:=xlPasteFormats, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Application.CutCopyMode = False
 
Try
Code:
Sub MM1()
Dim wb1 As Workbook, wb2 As Workbook
'Now, copoy what you want from wb1:
wb1.Sheets("name of copying sheet").Range("A1:S84").Copy
'Now, paste to WB2 worksheet:
wb2.Sheets("name of sheet to be pasted to").Range("A1").PasteSpecial Paste:=xlPasteValues
wb2.Sheets("name of sheet to be pasted to").Range("A1").PasteSpecial Paste:=xlPasteFormats
End Sub
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Great! It works thanks heaps! Now when I want to repeat this process fro another data set what do I post? As when I write dim a message comes up saying I cant duplicate the workbook?
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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