+ Reply to Thread
Results 1 to 7 of 7

Help editing VBA to work in module not sheet code

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    United States
    MS-Off Ver
    Mac 2021
    Posts
    12

    Help editing VBA to work in module not sheet code

    What do I need to do to modify this vba so I can use it in a module? I have two cells in my sheet (J44 and J63)that I want to run a version of this on, so I believe I need to put two different instances in individual modules.

    Please Login or Register  to view this content.
    Last edited by erinkm; 01-31-2021 at 09:27 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help editing VBA to work in module not sheet code

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    If posting code please use code tags, see here.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: Help editing VBA to work in module not sheet code

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help editing VBA to work in module not sheet code

    If you want the code to work for both cells try this.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-12-2012
    Location
    United States
    MS-Off Ver
    Mac 2021
    Posts
    12

    Re: Help editing VBA to work in module not sheet code

    Thank you! Part of the reason I asked how to separate it into modules is because I actually need to use a slightly different formula for J63, though.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help editing VBA to work in module not sheet code

    You don't really need to separate things for that, all you need to do is check which cell was changed.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-12-2012
    Location
    United States
    MS-Off Ver
    Mac 2021
    Posts
    12

    Re: Help editing VBA to work in module not sheet code

    Perfect! Thank you!

+ 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. Testing single code, work fine. Put multiple codes in one sheet, one code doesn't work.
    By MayDay1988 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2017, 06:14 PM
  2. [SOLVED] Help require to put the code in sheet module to work it automatically
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-19-2015, 08:48 AM
  3. Editing combo box VBA to work with 2 sheets instead of the same sheet
    By Pharmboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2014, 11:48 AM
  4. [SOLVED] Code locks cells when inserted in sheet module but returns error in standard module
    By yoda66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 07:39 AM
  5. How to copy sheet to new book without sheet module code?
    By MelinaT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2011, 11:52 AM
  6. how to access Sheet module, normal module, Worbook module to type code
    By alibaba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2009, 07:51 AM
  7. Passing variables and values between sheet code and module code
    By imux in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-14-2009, 12:23 PM

Tags for this Thread

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