+ Reply to Thread
Results 1 to 6 of 6

Private Sub Worksheet_Change(ByVal Target As Range) not working

  1. #1
    Forum Contributor
    Join Date
    10-29-2009
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    125

    Private Sub Worksheet_Change(ByVal Target As Range) not working

    Hi

    I have a Private Sub Worksheet_Change(ByVal Target As Range) macro that is not working.

    Basically this code is referencing a cell on another sheet so it is not activating. Does anyone have any ideas I may try?

    If the cell is in the same sheet press F2 then enter the code works. But as the cell is on a different sheet nothing happens

    Many thanks!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Private Sub Worksheet_Change(ByVal Target As Range) not working

    Hi,

    It would be a big help if you could share the procedure code with us.

    Better still upload the workbook and tell us which sheet is involved.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Private Sub Worksheet_Change(ByVal Target As Range) not working

    If you wish to use the change event it must be in the sheet where the cell is being changed. That is unavoidable.

  4. #4
    Forum Contributor
    Join Date
    10-29-2009
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    125

    Re: Private Sub Worksheet_Change(ByVal Target As Range) not working

    Hi Richard,

    Attached is my workbook
    Sheet1 contains the TextBox which references named cell on Sheet2 "Companies"

    What I want to achieve....
    "Companies" contains a formula which will pick up any changes to the list of Companies YELLOW
    The TextBox does register the change but truncates to ONLY the first 255 chars. The code was to make TextBox have more than 255 chars

    I hope I am making sense and thank you for any assistance you may give.
    Attached Files Attached Files

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Private Sub Worksheet_Change(ByVal Target As Range) not working

    Hi,

    Why do you need to use a Drawing shape and jump through all the hoops of VBA code.

    Why not just merge a range of cells (one of the very few occasions I would encourage this), and choose 'wrap text' - say E9:N18 on sheet1 then in E9 use the formula =Companies

  6. #6
    Forum Contributor
    Join Date
    10-29-2009
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    125

    Re: Private Sub Worksheet_Change(ByVal Target As Range) not working

    Yeah I did decide to do this in the end

    Thanks Richard for your time!

+ 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) End Sub
    By kanonathena in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 12:25 AM
  2. 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
  3. [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
  4. [SOLVED] 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
  5. 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