Results 1 to 1 of 1

Thread: how to run 2 VBA codes on 1 sheet

  1. #1
    Neophyte hh2021's Avatar
    Join Date
    Jun 2021
    Excel Version

    how to run 2 VBA codes on 1 sheet

    Register for a FREE account, and/
    or Log in to avoid these ads!

    I tried to run 2 simple codes they worked separately. When I ran them together the data was interfered with each other. Please help. Thank you :-)

    Sub calc1()
    Range("$D$2").Value = Range("$D$2").Value + Range("$C$2").Value
    End Sub

    Sub calc2()
    Range("$D$10").Value = Range("$D$10").Value + Range("$C$10").Value
    End Sub

    Private Sub Worksheet_Calculate()
    Call calc1
    Call calc2
    End Sub

    I tried Range("D210").Value = Range("D210").Value + Range("C2:C10").Value not working any idea?
    Last edited by hh2021; 2021-06-19 at 06:07 PM. Reason: typoerror

Posting Permissions

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