Solved

VBA Pastespecial

Posted on 2012-03-15
3
339 Views
Last Modified: 2012-03-15
I need to paste the entire contents of one worksheet to another but only its formatting and values (no formulas).

I am using this so far:

wksDb.Cells.Copy wksOut.Cells

Open in new window

0
Comment
Question by:mcnuttlaw
3 Comments
 
LVL 13

Assisted Solution

by:Shanan212
Shanan212 earned 250 total points
ID: 37725514
assuming you paste on A1


wksDb.Cells.Copy
wksOut.range("A1").select
Selection.PasteSpecial xlPasteValuesAndNumberFormats

Open in new window

0
 
LVL 14

Accepted Solution

by:
Zack Barresse earned 250 total points
ID: 37725558
@Shanan212: You don't need to Select anything here.  Just access the range object...
wksDb.Cells.Copy
wksOut.range("A1").PasteSpecial xlPasteValuesAndNumberFormats

Open in new window


HTH
Regards,
Zack Barresse
0
 
LVL 2

Author Comment

by:mcnuttlaw
ID: 37725636
Thank you both.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Select/Copy row and pasting it lower in sheet 7 19
Excel Cell Total 3 20
VLOOKUP 6 17
Excel VBA Select non contiguous cells in a loop 4 27
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

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