Insert multiple column values from one sheet to another via VBA

  • I trying to insert multiple column values from many sheets (eg- sheet 1, sheet2, sheet3 which have the same format) to another master sheet (sheet 7) using a command button in sheet1, sheet2, sheet3 to push the data of these sheets to the cells in sheet7 so that everytime the command button in each sheet is clicked, the data is updated in the cells in Sheet7.I don't want to create multiple master sheets like Sheet7 by using excel formulae. Instead I am trying to achieve this using excel VBA. My codes are given below, but while running the code, the error pops up saying the "Compile error:procedure too large". How can I shorten the codes to achieve the task.

    [/QUOTE][/CODE]

  • Re: Insert multiple column values from one sheet to another via VBA


    Code
    Sub a()
    Sheet4.Range("Y1").Value = Sheet3.Range("C3").Value
    Sheet4.Range("Z1").Value = Sheet3.Range("G3").Value
    Sheet4.Range("B3").Value = Sheet3.Range("C2").Value
    Sheet4.Range("A5:B54").Value = Sheets3.Range("A9:B58").Value
    End Sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!