Results 1 to 2 of 2

Thread: worksheet selection change setting the target range

  1. #1
    Acolyte Heyjoe's Avatar
    Join Date
    Jan 2019
    Location
    USA
    Posts
    55
    Articles
    0
    Excel Version
    2019

    worksheet selection change setting the target range



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello excel programmers:

    As often happens the way I think VBA is supposed to work does not work.

    Is there a way to tell excel that you only want the selectionchange event to work when cell b1 changes?

    The following is code that I wrote that does not work.


    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    
    Set Target.Range = Range("b1")
    If Target.Range.Value = "blue items" Then
    Call makevisible
    End If
    End Sub
    Last edited by Heyjoe; 2019-06-01 at 03:54 PM. Reason: never finished my question.

  2. #2
    Conjurer alansidman's Avatar
    Join Date
    Oct 2018
    Location
    Steamboat Springs
    Posts
    159
    Articles
    0
    Excel Version
    2019
    Instead of worksheet selection change, try worksheet change event.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •