ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   paste values macro (https://www.excelbanter.com/excel-programming/349198-paste-values-macro.html)

dogpigfish

paste values macro
 
I am bouncing around code for this and overcomplicating it. What code can I
use to paste all values on every sheet for every cell.

Tom Ogilvy

paste values macro
 
for each sh in Worksheets
sh.UsedRange.Cells.Value = sh.UsedRange.Cells.Value
Next

Merged cells may be problematic (aren't they always) - I haven't tested it
with those.
--
Regards,
Tom Ogilvy


"dogpigfish" wrote in message
...
I am bouncing around code for this and overcomplicating it. What code can

I
use to paste all values on every sheet for every cell.




dogpigfish

paste values macro
 
Thanks, but I ended up using this. Thanks for pointing me in the right
direction. i was having trouble with the paste values function.

For Each sh In Worksheets
Range("a19:d23").Select
Selection.Copy
Range("a19:d23").Select
Selection.PasteSpecial Paste:=xlPasteValues

Next

End Sub

"Tom Ogilvy" wrote:

for each sh in Worksheets
sh.UsedRange.Cells.Value = sh.UsedRange.Cells.Value
Next

Merged cells may be problematic (aren't they always) - I haven't tested it
with those.
--
Regards,
Tom Ogilvy


"dogpigfish" wrote in message
...
I am bouncing around code for this and overcomplicating it. What code can

I
use to paste all values on every sheet for every cell.





Tom Ogilvy

paste values macro
 
I think you will be disappointed in the results. Instead, modify it like
this

For Each sh In Worksheets
sh.Activate
Range("a19:d23").Select
Selection.Copy
Range("a19:d23").Select
Selection.PasteSpecial Paste:=xlPasteValues
Next

--
Regards,
Tom Ogilvy


"dogpigfish" wrote in message
...
Thanks, but I ended up using this. Thanks for pointing me in the right
direction. i was having trouble with the paste values function.

For Each sh In Worksheets
Range("a19:d23").Select
Selection.Copy
Range("a19:d23").Select
Selection.PasteSpecial Paste:=xlPasteValues

Next

End Sub

"Tom Ogilvy" wrote:

for each sh in Worksheets
sh.UsedRange.Cells.Value = sh.UsedRange.Cells.Value
Next

Merged cells may be problematic (aren't they always) - I haven't tested

it
with those.
--
Regards,
Tom Ogilvy


"dogpigfish" wrote in message
...
I am bouncing around code for this and overcomplicating it. What code

can
I
use to paste all values on every sheet for every cell.







dogpigfish

paste values macro
 
This was the final code in case anyone was interested. Again, thanks for
your help and direction, Tom.

For Each sh In Worksheets
sh.Activate
sh.Range("a19:d23").Select
Selection.Copy
sh.Range("a19:d23").Select
Selection.PasteSpecial Paste:=xlPasteValues
Next


"Tom Ogilvy" wrote:

I think you will be disappointed in the results. Instead, modify it like
this

For Each sh In Worksheets
sh.Activate
Range("a19:d23").Select
Selection.Copy
Range("a19:d23").Select
Selection.PasteSpecial Paste:=xlPasteValues
Next

--
Regards,
Tom Ogilvy


"dogpigfish" wrote in message
...
Thanks, but I ended up using this. Thanks for pointing me in the right
direction. i was having trouble with the paste values function.

For Each sh In Worksheets
Range("a19:d23").Select
Selection.Copy
Range("a19:d23").Select
Selection.PasteSpecial Paste:=xlPasteValues

Next

End Sub

"Tom Ogilvy" wrote:

for each sh in Worksheets
sh.UsedRange.Cells.Value = sh.UsedRange.Cells.Value
Next

Merged cells may be problematic (aren't they always) - I haven't tested

it
with those.
--
Regards,
Tom Ogilvy


"dogpigfish" wrote in message
...
I am bouncing around code for this and overcomplicating it. What code

can
I
use to paste all values on every sheet for every cell.








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

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