+ Reply to Thread
Results 1 to 3 of 3

attempting/failing the private sub worksheet_change(byval target as range function...

  1. #1
    Registered User
    Join Date
    09-16-2022
    Location
    Boston
    MS-Off Ver
    Excel 16.64
    Posts
    5

    attempting/failing the private sub worksheet_change(byval target as range function...

    I am trying to use the private sub worksheet_change(byval target as range) function, but I am having trouble with it.

    I have my set up as follows:

    A1 B1 C1 D1 E1 (where I want E1 to equal A1 or B1 or C1 or D1)
    A2 B2 C2 D2 E2 (where I want E2 to equal A2 or B2 or C2 or D2)
    A3 B3 C3 D3 E3 (where I want E3 to equal A3 or B3 or C3 or D2)

    I want to be able to select A1, B1, C1, or D1 by double clicking that cell so it shows up in E1, but NOT in E2 or E3, but my code makes it so that E1, E2, AND E3 become whatever cell I click. The code is currently written as:

    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Range("E1", E3 ).Value = ActiveCell.Value
    End Sub

    HOW SHOULD I CHANGE THIS CODE TO GET IT TO RUN THE WAY I WANT IT TO? Thank you in advance for the support.

  2. #2
    Registered User
    Join Date
    09-16-2022
    Location
    Boston
    MS-Off Ver
    Excel 16.64
    Posts
    5

    Re: attempting/failing the private sub worksheet_change(byval target as range function...

    Forgot to mention that I want to then be able to click A2 B2 C2 or D2 to have E2 change to whatever I click. And then I would want the same for the following rows

  3. #3
    Registered User
    Join Date
    09-16-2022
    Location
    Boston
    MS-Off Ver
    Excel 16.64
    Posts
    5

    Re: attempting/failing the private sub worksheet_change(byval target as range function...

    Sample .xlsm

    here is a sample of the excel

+ 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. Private Sub Worksheet_Change(ByVal Target As Range)
    By PIM499 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2019, 01:07 AM
  2. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range)
    By TheTallOne in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-28-2018, 11:19 AM
  3. [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
  4. 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
  5. [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
  6. [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
  7. 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

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