An alternate for PasteSpecial Paste:=xlPasteFormats

Dhanya Saseendran

New Member
Joined
Dec 26, 2014
Messages
1
Hi,

The goal of my macro is -
For a particular condition of a column, (Field 'Detailed Status' when having a value 'Escalated') copy certain columns to a new Excel worksheet.

Points where I need help is
1. I have been using PasteSpecial Paste:=xlPasteFormats while copying as shown below. But this is taking too long a time. It is enough for me if I copy the format from a single field in the masterSheet. But since I did not know how to do it I have been using the below code.
masterSheet.Range(colIndex & index).Copy
escSheet.Range(escColIndex & escSheetIndex).PasteSpecial Paste:=xlPasteFormats
escSheet.Range(escColIndex & escSheetIndex).PasteSpecial Paste:=xlPasteValues
2. Increase the column width after copying to the escSheet
3. escSheet ("Escalation Report") is currently a Worksheet in the same active workbook. And once all the copy is done, I copy this sheet to another workbook and delete the current sheet. I want to copy this new Workbook to a sheet in the Active folder rather than the current "C:\"

ThisWorkbook.Sheets("Escalation Report").Copy
ActiveWorkbook.SaveAs "C:\Escalation Report.xlsx", FileFormat:=51
ThisWorkbook.Sheets("Escalation Report").Delete


Please help me on the above points. Let me know if you need more information
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,214,381
Messages
6,119,192
Members
448,874
Latest member
Lancelots

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