VBA code help

jj9810

New Member
Joined
Dec 10, 2020
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
Hey guys. This is my first time posting. So, I am woking on an Excel file where I have a table with a specific format and formulas within it. I want a macro that will create a new sheet with the same table format. What I did before was a macro that duplicated the sheet, but that's the best I did since I was not able to clean the table and leave just one row without data, just formulas.
Appreciate any help.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hello jj9810,
try this...
Use pastespecial multiple time.

First copy range on sheet1 left side of the formulas you want to keep and paste special on the sheet 2 on the same location with "paste values" option.
Repeat that selecting right side range on the sheet1.
Repeat that selecting middle up and middle down cells on the sheet1.

If you want to copy formats also repeat all that but on paste special with only "paste format" option.
In the end copy center cells on sheet1 and paste special with "paste all" option.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

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