+ Reply to Thread
Results 1 to 6 of 6

Combine codes into one macro

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Powell, near Knoxville, TN
    MS-Off Ver
    Office 2010
    Posts
    26

    Combine codes into one macro

    Hi,

    I'm very new to this. I have two codes I would like to combine for a single macro because I can't get the second code to run in Sheet 3. The first code is in the Sheet 3 View Code box.

    Please Login or Register  to view this content.
    and the second code is in a module created from Sheet 3.

    Please Login or Register  to view this content.
    Currently, the second code (in module 1) is not working on Sheet 3, but it does work on other sheets where I have it in the Sheet View Code box of the sheet.

    When I look in the View Macro's box I see no macros. Am I missing a step or something?

    Thanks,

    Russ

  2. #2
    Registered User
    Join Date
    04-22-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Combine codes into one macro

    Try removing the 'Private' then see if it works.

  3. #3
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: Combine codes into one macro

    create another macro..that will call them all

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Combine codes into one macro

    Worksheet_Change is not a module base Subroutine..
    its Event base Subroutine..
    You need enter the code in Worksheet Module.. (right click sheet name , and select View Code)

    BTW.. two event macro will not work.. you need to use a sinlge Worksheet_Change code..

    try this..

    Please Login or Register  to view this content.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    Powell, near Knoxville, TN
    MS-Off Ver
    Office 2010
    Posts
    26

    Re: Combine codes into one macro

    Debraj,

    Thanks for the help. It's working for the most part but the value of cell O152 changes when it should not. Cell O152 is formated "=A8". The second code should cause cell O152 to retain the first value returned and not change as the data entered in A8 changes. Each of these formulas work by themselves, but I can't get them to work together.

    Can you help please,

    Thanks.

    Russ

  6. #6
    Registered User
    Join Date
    06-26-2013
    Location
    Powell, near Knoxville, TN
    MS-Off Ver
    Office 2010
    Posts
    26

    Re: Combine codes into one macro

    Thanks Debraj,

    Got the formula to work by changing A8 to $A$8.

    Thanks for the advice. I really appreciate the help.

    Russ

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to combine two VBA codes into one avtion?
    By jjotc23 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2013, 10:30 AM
  2. [SOLVED] How to combine these two set's of codes?
    By aadeshgandhi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2013, 07:26 PM
  3. combine codes
    By Oeysbrei in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2012, 03:38 AM
  4. Combine vba codes
    By mmwltd in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-22-2010, 08:32 AM

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