+ Reply to Thread
Results 1 to 6 of 6

VBA to combine/call two subs in Worksheet_SelectionChange(ByVal Target As Range)

  1. #1
    Registered User
    Join Date
    09-26-2019
    Location
    usa
    MS-Off Ver
    10
    Posts
    19

    VBA to combine/call two subs in Worksheet_SelectionChange(ByVal Target As Range)

    Hi I'm trying to combine two subs by calling them in the Worksheet_selectionChange(byVal Target as Range)

    Below is the code and 2 subs I'm trying to call/combine.

    The first code runs and works fine but can't seem to get the second to run. Any help would be appreciated!

    Thanks in advance!

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by nate.oyen; 01-06-2020 at 02:35 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: VBA to combine/call two subs in Worksheet_SelectionChange(ByVal Target As Range)

    The code you provided is worksheet_change not worksheet_selectionchange

  3. #3
    Registered User
    Join Date
    09-26-2019
    Location
    usa
    MS-Off Ver
    10
    Posts
    19

    Re: VBA to combine/call two subs in Worksheet_SelectionChange(ByVal Target As Range)

    Sorry, I changed it. Pretty new to VBA. How could I get these to subs to run within my
    Private Sub Worksheet_SelectionChange(ByVal Target As Range) ??

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: VBA to combine/call two subs in Worksheet_SelectionChange(ByVal Target As Range)

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-26-2019
    Location
    usa
    MS-Off Ver
    10
    Posts
    19

    Re: VBA to combine/call two subs in Worksheet_SelectionChange(ByVal Target As Range)

    Thank you for your assistance, however I'm running into a runtime error.

    I have attached the workbook I'm working with for a better understanding.

    Appreciate it very much if you could take a look at it.
    Attached Files Attached Files

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: VBA to combine/call two subs in Worksheet_SelectionChange(ByVal Target As Range)

    Intersect(Application.ActiveSheet.Range("phonenumfield,F14:2500"), Target)
    F14:2500 is not a range.

    When you fix that, make sure all variables are declared in the code.

+ 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] Worksheet_SelectionChange(ByVal Target As Range) - Not Firing!
    By Break_Point in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2013, 06:44 AM
  2. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    By whitesapphire24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-28-2011, 05:08 AM
  3. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    By dcdusek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2009, 03:04 PM
  4. insert Worksheet_SelectionChange(ByVal Target As Range) through vba
    By scott in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2006, 10:50 AM
  5. Worksheet_SelectionChange(ByVal Target As Range) questions
    By Gary Keramidas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2005, 06:05 AM
  6. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    By tawnee jamison in forum Excel General
    Replies: 0
    Last Post: 04-20-2005, 05:13 PM
  7. Ranges:Target in Worksheet_SelectionChange(ByVal Target As Range)
    By Kevin McCartney in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2005, 09:06 AM
  8. [SOLVED] Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    By Arturo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2005, 03:06 PM

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