+ Reply to Thread
Results 1 to 8 of 8

Merging Two VBA Codes to one Code

  1. #1
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Merging Two VBA Codes to one Code

    Hello

    Can someone help me in merging the below two VBA codes to into one VBA code.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Merging Two VBA Codes to one Code

    Untested, see if it works for you

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Merging Two VBA Codes to one Code

    Try calling the 2 subs and keeping Worksheet_Change clear of clutter
    - makes it easier to add other things later if necessary
    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Re: Merging Two VBA Codes to one Code

    Hello

    Above code is working but Not all the cells are getting locked.

  5. #5
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Re: Merging Two VBA Codes to one Code

    Hello

    Above code is working but Not all the cells are getting locked.

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Merging Two VBA Codes to one Code

    Which code are you referring to?

  7. #7
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Merging Two VBA Codes to one Code

    The target cell has to be in column 2 for the locking part of the code to execute. Otherwise only the second part of the code will execute. Same thing with kev- 's version, it only calls the locking macro if target is in column 2.

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Merging Two VBA Codes to one Code

    Above code is working but Not all the cells are getting locked
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

+ 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. Need help merging 2 codes together.
    By danbates in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2019, 11:11 AM
  2. Replies: 7
    Last Post: 08-13-2015, 10:58 AM
  3. merging two codes into one
    By cybrkada in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-02-2014, 06:22 AM
  4. Help merging two VBA codes
    By andyaf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 11:27 PM
  5. [SOLVED] Merging 2 VBA Codes
    By crusader0011 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-30-2013, 05:36 PM
  6. Merging two vba codes
    By yorilla in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 05:19 AM
  7. Merging Two Codes Into one code
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-27-2005, 12:13 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