How to copy a sheet with format (template) and apply or paste it to another sheet (with existing data)

Hi All,

Please help me out. I want to copy the template sheet format to a new sheet with existing data. Do you have any ideas? Like using hotkeys? Thanks!

Here is the template format that i wanna copy (with hidden columns).

This is a sheet i want to apply with template format.

Regards,
Miko

Hi…
here are the steps for you to solve hope it works:-

*open excel- give a random click in between to activate it.
*then ctrl+home
*ctrl+shift+right

  • alt+h
    *o
    *u
    *L
    these steps will unhide the columns first. After that you can copy paste.

Hi @rahul599756, Thanks for this. But i cant imagine the solution you are trying to say. Can you please give me sample WF as my reference or any screenhots of your WF? Thanks.

Please note that i just want to copy the template format (with hidden columns) to a new sheet. Thanks!

I don’t have any sample flow sorry. I was trying manually.

Hi @baldonazamiko,

Please take a look . It will fix your problem.

Regards
Balamurugan.S

hi @baldonazamiko,

You can use the below sample lines of code in invoke code activity

ws1=CType(wb.Sheets(“Sheet1”),Microsoft.Office.Interop.Excel.Worksheet)

ws.cells.Copy()
ws1.cells.PasteSpecial(XlPasteType.xlPasteValues)

Regards
Sanjay Shankhla

Hi Sanjay,

I have tried using this code to copy sheet to another workbook sheet…But am getting syntax errors for wSourece,wDestination and XLPasteSpecial as not declared…

wSource=CType(wS.Sheets(“Payroll Summary”),Microsoft.Office.Interop.Excel.Worksheet)
wDestination=CType(wD.Sheets(“G2N”),Microsoft.Office.Interop.Excel.Worksheet)

wSource.cells.Copy()
wDestination.cells.PasteSpecial(XlPasteType.xlPasteAllUsingSourceTheme)

ws and wd are workbook data types from excel application scope.
Could you please help me out

Hi @Shana_Shaik

Check with below line
Ws.range(“a1”,“c10”).Copy

Regards
Sanjay