ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PasteSpecial Values (https://www.excelbanter.com/excel-programming/307110-pastespecial-values.html)

Patch[_2_]

PasteSpecial Values
 
Hi!

I have this code provided by Tom Ogilvy (thanks Tom!)but I
need to have it modified to PasteSpecial Values as some of
the cells that are copied have values returned by formulas.
I tried doing it but my VBA skills are basically limited
to using the macro recorder.

Sub Tester9()
Dim rng As Range, rng1 As Range
Dim cell As Range, i As Long
Set rng1 = Worksheets("Summary") _
.Cells(Rows.Count, 1).End(xlUp)(2)
Set rng = Range("A10,A11,E22,F22,G22,H22,K60,L60,M60")

i = 0
For Each cell In rng
cell.Copy Destination:=rng1.Offset(0, i)
i = i + 1
Next
MsgBox "Pasted at " & rng1.Address
End Sub

Thanks for your help.

Don Guillett[_4_]

PasteSpecial Values
 
instead of
cell.Copy Destination:=rng1.Offset(0, i)
try
rng1.Offset(0, i).value=cell

--
Don Guillett
SalesAid Software

"Patch" wrote in message
...
Hi!

I have this code provided by Tom Ogilvy (thanks Tom!)but I
need to have it modified to PasteSpecial Values as some of
the cells that are copied have values returned by formulas.
I tried doing it but my VBA skills are basically limited
to using the macro recorder.

Sub Tester9()
Dim rng As Range, rng1 As Range
Dim cell As Range, i As Long
Set rng1 = Worksheets("Summary") _
.Cells(Rows.Count, 1).End(xlUp)(2)
Set rng = Range("A10,A11,E22,F22,G22,H22,K60,L60,M60")

i = 0
For Each cell In rng
cell.Copy Destination:=rng1.Offset(0, i)
i = i + 1
Next
MsgBox "Pasted at " & rng1.Address
End Sub

Thanks for your help.




Patch[_2_]

PasteSpecial Values
 
Thanks Don! That works.

-----Original Message-----
instead of
cell.Copy Destination:=rng1.Offset(0, i)
try
rng1.Offset(0, i).value=cell

--
Don Guillett
SalesAid Software

"Patch" wrote in

message
...
Hi!

I have this code provided by Tom Ogilvy (thanks Tom!)

but I
need to have it modified to PasteSpecial Values as some

of
the cells that are copied have values returned by

formulas.
I tried doing it but my VBA skills are basically limited
to using the macro recorder.

Sub Tester9()
Dim rng As Range, rng1 As Range
Dim cell As Range, i As Long
Set rng1 = Worksheets("Summary") _
.Cells(Rows.Count, 1).End(xlUp)(2)
Set rng = Range("A10,A11,E22,F22,G22,H22,K60,L60,M60")

i = 0
For Each cell In rng
cell.Copy Destination:=rng1.Offset(0, i)
i = i + 1
Next
MsgBox "Pasted at " & rng1.Address
End Sub

Thanks for your help.



.


Don Guillett[_4_]

PasteSpecial Values
 
glad to help

--
Don Guillett
SalesAid Software

"Patch" wrote in message
...
Thanks Don! That works.

-----Original Message-----
instead of
cell.Copy Destination:=rng1.Offset(0, i)
try
rng1.Offset(0, i).value=cell

--
Don Guillett
SalesAid Software

"Patch" wrote in

message
...
Hi!

I have this code provided by Tom Ogilvy (thanks Tom!)

but I
need to have it modified to PasteSpecial Values as some

of
the cells that are copied have values returned by

formulas.
I tried doing it but my VBA skills are basically limited
to using the macro recorder.

Sub Tester9()
Dim rng As Range, rng1 As Range
Dim cell As Range, i As Long
Set rng1 = Worksheets("Summary") _
.Cells(Rows.Count, 1).End(xlUp)(2)
Set rng = Range("A10,A11,E22,F22,G22,H22,K60,L60,M60")

i = 0
For Each cell In rng
cell.Copy Destination:=rng1.Offset(0, i)
i = i + 1
Next
MsgBox "Pasted at " & rng1.Address
End Sub

Thanks for your help.



.





All times are GMT +1. The time now is 02:07 AM.

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