How do I in Excel VBA paste values for multiple worksheets within a workbook

I have 1 workbook and 3 worksheets.  All 3 worksheets have numerous formulas.  Once I am done with all the processing, I want to be able to within VBA:
1-Copy worksheet 1 and do a paste special values for the entire worksheet with the destination worksheet being the same worksheet (1)
2-Copy worksheet 2 and do a paste special values for the entire worksheet with the destination worksheet being the same worksheet (2)
3-Copy worksheet 2 and do a paste special values for the entire worksheet with the destination worksheet being the same worksheet (3)

Any suggestions
upobDaPlayaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nutschCommented:
Assuming you have no merged cells, try the following code

sub copypastevalues
dim lLoop as long

for lloop=1 to 3
sheets(lloop).usedrange.copy
sheets(lloop).usedrange.pastespecial paste:=xlpastevalues
next lloop

end sub

Open in new window

0
broro183Commented:
Here is a slight variation on Nutsch's code which avoids use of the clipboard & may be faster. The caveat about merged cells also applies to this version.

Option Explicit

Sub ChangeToValues()
Dim lLoop As Long

    For lLoop = 1 To 3
        With Sheets(lLoop).UsedRange
            .Value = .Value
        End With
    Next lLoop

End Sub

Open in new window


hth
Rob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
upobDaPlayaAuthor Commented:
Perfect...thank you...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.