Solved

Excel 2007 - Can I Use "Paste Special" to paste Values AND Formatting?

Posted on 2012-03-22
3
234 Views
Last Modified: 2012-03-25
I have constructed a spreadsheet with VLOOKUP formulas, as well as some simple SUM formulas.  I have also used some basic formatting (cell fill colors, bold fonts, some merged cells, etc.) to help in making reading certain cells/columns easier to identify quickly.

Each week, I need to copy the entered and calculated information, paste the data into it's own worksheet (data only - no formulas) and then start over with the original template and it's formulas with the next week's data.  

Of course, I know how to paste values only, but then I am required to make a number of manual steps with the pasted data (centering of text in some columns, adjusting the date column to the correct format, etc.) to keep the data easily readable.

With this spreadsheet retaining merged cells isn't that important but retaining the visual/style formatting is.

Is there a way to "Paste Special" that will paste the cell Values AND Formatting, retaining all the shading, bold fonts, date style, merged cells, merged cells, etc?

Thanks to all.
0
Comment
Question by:Duchenne
  • 2
3 Comments
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
No, unfortunately it has to be in two steps.

Use this code and set a control key to run this macro (perhaps in your personal.xls(b)?)
Sub pasteValuesAndFormats()

    With ActiveCell
        .PasteSpecial xlPasteFormats
        .PasteSpecial xlPasteValues
    End With
    
End Sub

Open in new window


Let me know if you need further assistance.

Dave
0
 
LVL 41

Accepted Solution

by:
dlmille earned 500 total points
Comment Utility
I reposted the code above, after some testing, to make it a bit cleaner.


Hit Alt-F11 to get to the VBA editor.  Look to the left and seek out your workbook name, click right on where it says VBProject(your workbookname) and select Insert Module.

Then paste the code I posted (above).

You can close the VBA editor and go back to your workbook by hitting the excel icon on the top/left or just hit the X at the top right.

Then, Tools->Macros (or Ribbon Developer->Macros) select the macro name "pasteValuesAndFormats" and then click Options button and assign your short-cut key.

From that point forward, you can then use that control sequence to run the macro and do both paste values and formats!

HTH

Dave
0
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
When you do a normal paste, you should get a smart tag appear with the option to paste values and formatting.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now