+ Reply to Thread
Results 1 to 2 of 2

Show Userform if cell with specific text is pressed

Hybrid View

  1. #1
    Registered User
    Join Date
    02-02-2015
    Location
    Portland
    MS-Off Ver
    2013
    Posts
    32

    Show Userform if cell with specific text is pressed

    Hello all,

    I was wondering if it would be possible to display a Userform if a cell with specific text is pressed. I've gotten this to work with the following code, but if multiple cells are selected, an error appears.
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Value = "This Text" Then
        UserformX.Show
    Else
        Exit Sub
    End If
    
    End Sub

  2. #2
    Registered User
    Join Date
    02-02-2015
    Location
    Portland
    MS-Off Ver
    2013
    Posts
    32

    Re: Show Userform if cell with specific text is pressed

    Sorry for the trouble, solved my own issue by using the following code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    If Selection.Cells.count = 1 Then
        If Target.Value = "This Text" Then
        UserFormX.Show
    End If
    End If
    End Sub

+ 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] Macro code to show only the rows with specific cell text in a particular column
    By Itachi1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2013, 01:33 PM
  2. How to copy a range of columns from sheet1 to sheet2 if the cell show a specific text
    By chermaine123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2011, 02:39 AM
  3. Enter text into a specific cell using a userform
    By Cushionsupplier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2010, 05:38 PM
  4. Show cell comments in userform text box.
    By Yappa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2008, 01:15 AM
  5. select [a1]cell when hotkey(ctrl+q) pressed, after userform load
    By x taol in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2006, 06:10 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