Copying sheet with hidden columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
By using code and a command button, I am creating a new sheet (sheet 2) and
copying the contents of Sheet 1 to it. Works well except that i have formulae
in the hidden columns and they are not being copied to Sheet 2.
How can I get around this?
 
Hi Jock,

Instead of creating a new sheet and copying cells etc to it; Use the Copy
sheet method.

Right click on the sheet name and select Move or copy and follow it from
there. (You need to check the create copy box to copy)

Record a macro while doing it if you need the VBA code.

Regards,

OssieMac
 
Hi OssieMac,
Thanks for the suggestion, however, I already have vba set up which creates
a new sheet, names it and copies the active sheet to it. All works fine
except for the formulae in hidden columns which aren't copied over. The
hidden columns are still hidden, by the way, just with no data.
 
Hi, Jock!
Are you saying if you unhide the column on the copy and select a cell where
a formula should be, it doesn't show in the formula bar?
James
 
Hi Jock,

Does you code look something like this because if it does it should make an
exact duplicate of the original sheet and give it a new name.

Sheets("Sheet1").Copy Before:=Sheets(1)
ActiveSheet.Name = "New Sheet"

If you still have problems then can you post a copy the code you are using.

Regards,

OssieMac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top