+ Reply to Thread
Results 1 to 5 of 5

Copy and Paste Value macro on multiple sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    13

    Copy and Paste Value macro on multiple sheets

    I have searched on the forum for an answer to my problem but cannot seem to find anything.

    I have attached a example.

    I have 3 sheets (GP, CT and EL), each sheet represent employees and hours. The amount of employees varies every month. I have formulas in row 1 which I would like to copy and paste value down for these employees. The formulas can be found in Row 1 columns D & E. I would like the formula to copy and paste value only to the last line which have a employee name in. The formula's in D1 and E1 I would like to keep so that I can use it to do spot checks.

    I hope someone can help.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy and Paste Value macro on multiple sheets

    This should do it:

    Option Explicit
    
    Sub AddValuesFromFormulas()
    Dim ws As Worksheet, LR As Long
    
    For Each ws In Sheets(Array("GP", "CT", "EL"))
        LR = ws.Range("A" & Rows.Count).End(xlUp).Row
        With ws.Range("D4:E" & LR)
            ws.Range("D1:E1").Copy
            .PasteSpecial xlPasteFormulas
            .Value = .Value
        End With
    Next ws
    
    Application.CutCopyMode = False
    End Sub
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Copy and Paste Value macro on multiple sheets

    Hallo Elmarie_Potgieter,

    Welkom by die Forum,

    JBeaucaire gave you a very nice solution, and I thought that maybe you would need some help in putting it all together. If my assumption is correct, then please see the attached sample WorkBook.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    04-18-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: Copy and Paste Value macro on multiple sheets

    Thank you for helping me JBeaucaire and Winon.

    This will make my life so much easier.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy and Paste Value macro on multiple sheets

    I've marked this thread as SOLVED for you.
    Next time, select Thread Tools from the links above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1