ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pastespecial on a worksheet question (https://www.excelbanter.com/excel-programming/291067-pastespecial-worksheet-question.html)

mike

pastespecial on a worksheet question
 
I'm looking for help with pastespecial. On worksheet
("RI") there is a function that coverts number 2200.00 to
two thousand two hundred dollars.

I want to copy the info on worksheet ("RI") and
pastespecial on worksheet ("C"). Here is the code I
tried:

Sheets("RI").Select
Range("B8").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

Sheets("C").Select
Range("A1").Select
ActiveSheet.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= False, Transpose:=False

I get an error at this point. I also tried this:

Sheets("C").Select
Range("A1").Select
ActiveSheet.paste

Cells.select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
_ SkipBlanks:= False, Transpose:=False


However, after Activesheet.Paste, the macro immediately
jumps to the function code and begins stepping through
that. I was trying to avoid going through the function
code again because I want to use these fields in a mail
merge and I need to have the values and not the function.

Any ideas are greatly appreciated. Thanks for the help.

Don Guillett[_4_]

pastespecial on a worksheet question
 
try
Range("b3").CurrentRegion.copy _
Sheets("C").Range("A1").PasteSpecial Paste:=xlValues

--
Don Guillett
SalesAid Software

"mike" wrote in message
...
I'm looking for help with pastespecial. On worksheet
("RI") there is a function that coverts number 2200.00 to
two thousand two hundred dollars.

I want to copy the info on worksheet ("RI") and
pastespecial on worksheet ("C"). Here is the code I
tried:

Sheets("RI").Select
Range("B8").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

Sheets("C").Select
Range("A1").Select
ActiveSheet.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= False, Transpose:=False

I get an error at this point. I also tried this:

Sheets("C").Select
Range("A1").Select
ActiveSheet.paste

Cells.select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
_ SkipBlanks:= False, Transpose:=False


However, after Activesheet.Paste, the macro immediately
jumps to the function code and begins stepping through
that. I was trying to avoid going through the function
code again because I want to use these fields in a mail
merge and I need to have the values and not the function.

Any ideas are greatly appreciated. Thanks for the help.





All times are GMT +1. The time now is 04:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com