macro copy and paste
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Macro: copy and paste tabs

Macro: copy and paste tabs

· High Priority · Version 2003

replyReply Tue 15 Nov 2011, 15:30Delegate Heather said...

Heather has attended:
Excel VBA Intro Intermediate course

Macro: copy and paste tabs

I use a macro created by an ex-colleague which copied and pasted two tabs from a workbook into a new book.

It was done by recording a macro and in the past has copied and pasted both worksheets as values (both have many formulae). However i have made some adjustments to some formulae and now only these paste as "=N/A" when i run the macro. I have stepped through the macro and it is very early on where the "N/A"s appear.

The coding is as follows:

Sheets(Array("INPUT", "JOURNALS")).Select
Sheets("JOURNALS").Activate
Sheets(Array("INPUT", "JOURNALS")).Copy
Sheets(Array("INPUT", "JOURNALS")).Select

Is there any reason an adjusted formula would not copy accross? THe formula is as follows:

=IF(K26<>0,(VLOOKUP(K26,'CALL AC'!Print_Area,2,FALSE))," ")

Thanks,

Heather

For upcoming training course dates see: Pricing & availability

replyReply Tue 15 Nov 2011, 16:09Delegate Heather said...

RE: Macro: copy and paste tabs

I may have worked this our or at least found a if not the ideal solution. The vlookup was looking up values in a seperate tab. I then copied the table the formula was looking up into the current tab which i was copying and pasting, and it worked without N/As i then extended the macro to delete the table once the tabs had been copied.

Do copied and pasted as new book tabs not lookup in other tabs?

Thanks,

Heather

 

Please browse our web site to find out more about
microsoft-excel-training and other Microsoft training courses.

Excel tip:

The dual nature of toolbar buttons

Many toolbar buttons are dual purpose, though the two purposes are often linked in some way. For example, Align Left aligns a cell's contents to the left of the cell. However, hold down Shift and press the Align Left button: Excel aligns the cell contents to the right.
You may respond: So what? Well, you can reduce the number of buttons on your toolbar to make your screen less cluttered and allow more room for, perhaps, some of your own commands. After all, what's the point of an Align Right button when Shift+Align Left does the same thing?

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard