Copy paste values and formats

eazy899

New Member
Joined
May 17, 2016
Messages
14
Hi,

I am using the following code to copy over only the visible cells from 1 workbook to another due to the use of a filter.
However, some of these cells have formula so I need to copy over only formats and values as well.
How would i do this?

Code:
[/COLOR][COLOR=#333333]wb1.Worksheets(e).Range("A3:AM3000").SpecialCells(xlCellTypeVisible).Copy wb2.Worksheets(e).Range("A1")[/COLOR][COLOR=#333333]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Code:
[CODE][COLOR=#333333]wb1.Worksheets(e).Range("A3:AM3000").SpecialCells(xlCellTypeVisible).Copy
wb2.Worksheets(e).Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
[COLOR=#333333]wb2.Worksheets(e).Range("A1").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone[/COLOR]

[/COLOR]
[/CODE]
 
Upvote 0
Code:
[CODE][COLOR=#333333]wb1.Worksheets(e).Range("A3:AM3000").SpecialCells(xlCellTypeVisible).Copy
wb2.Worksheets(e).Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
[COLOR=#333333]wb2.Worksheets(e).Range("A1").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone[/COLOR]

[/COLOR]
[/CODE]


Hi ya,


Sorry but I just realised that the line of code that I provided was wrong.
I need what you provided but for the below.


For Each e In Array("Instructions", "Director Checklist")
wb1.Worksheets(e).Copy After:=wb2.Sheets(wb2.Sheets.Count)
Next e
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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