Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste Values pasting more than Values when called from VBA 1

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
I created this bit of code using the "Record Macros" feature to get the syntax for the paste properties right and it worked as expected when I was recording. But when I run the macro it takes the format and formulas. Is there a way to make it behave properly?

Sheets("Raw Paste").Select
Range("A2").Select
While ActiveCell.Value > " "
ActiveCell.Offset(1, 0).Select
DataRows = DataRows + 1
Wend


Sheets("Raw Paste").Select
Range("A2:B" & DataRows + 1).Select
Selection.Copy
Sheets("Intersection_Data").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Paste

Sheets("Raw Paste").Select
Range("W2:W" & DataRows + 1).Select
Selection.Copy
Sheets("Intersection_Data").Select
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Paste
 
For VBA questions, post in forum707

Also, use TGML tags to show your code.

Have fun.

---- Andy

There is a great need for a sarcasm font.
 
Remove

ActiveSheet.Paste

...in two places.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Skip - Great, Thanks.
Andy, I'll try to remember to use the other forum for such issues next time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top