+ Reply to Thread
Results 1 to 7 of 7

Private Sub Worksheet_Change(ByVal Target As Range)

Hybrid View

TheTallOne Private Sub... 08-27-2018, 03:02 PM
6StringJazzer Re: Private Sub... 08-27-2018, 04:36 PM
TheTallOne Re: Private Sub... 08-27-2018, 04:48 PM
6StringJazzer Re: Private Sub... 08-27-2018, 06:02 PM
TheTallOne Re: Private Sub... 08-28-2018, 10:13 AM
6StringJazzer Re: Private Sub... 08-28-2018, 11:11 AM
TheTallOne Re: Private Sub... 08-28-2018, 11:19 AM
  1. #1
    Registered User
    Join Date
    03-08-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Private Sub Worksheet_Change(ByVal Target As Range)

    I have this code that already works but I would like to add an email option to Column O but I can't seem to figure out the code to make this work with 3. When its just column M and N it works great. Any help would be great.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    Please attach your Excel file. You are using range names in your code instead of M and N so we can't how your question maps to your code and your Excel file.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-08-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    Here you go!
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    If I understand your question correctly this change should be all you need:
    ' Fire only if column M or N or O
    If Intersect(Target, Range("Table_Supply[[Send Email to Reorder]:[Email Peggy to Reorder]]")) Is Nothing Then Exit Sub

  5. #5
    Registered User
    Join Date
    03-08-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    What about [Email Katie to Reorder] for column N? When I add [Email Peggy to Reorder] it highlights that row of code in yellow up to Then

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    The syntax

    [Send Email to Reorder]:[Email Peggy to Reorder]

    means starting with column [Send Email to Reorder] and including all columns through [Email Peggy to Reorder] just as if you had written M:O.

    Does it give you an error message? I do not get an error when I run it.

  7. #7
    Registered User
    Join Date
    03-08-2018
    Location
    US
    MS-Off Ver
    2010
    Posts
    38

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    Thank you! That works great I didn't realize that it worked like that still trying to learn VBA.

+ 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] Private Sub Worksheet_Change(ByVal Target As Range)
    By hmr2662 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2015, 12:35 PM
  2. Private Sub Worksheet_Change(ByVal Target As Range)
    By BigJim68 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-27-2014, 01:57 PM
  3. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range) End Sub
    By kanonathena in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 12:25 AM
  4. Private Sub Worksheet_Change(ByVal Target As Range) Help
    By adamsj1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-28-2012, 09:17 AM
  5. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range)
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-18-2012, 01:13 AM
  6. Private Sub Worksheet_Change(ByVal Target As Range)
    By Arturo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2005, 11:06 AM
  7. Private Sub Worksheet_Change(ByVal Target As Range)
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2005, 02:59 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