Select a cell in column "C" and have UserForm pop up

RicnGean

New Member
Joined
Dec 8, 2019
Messages
10
Office Version
  1. 2010
Platform
  1. Windows
Thank you upfront for any help you can give.

I have Googled on this topic and gone to many of the links, tried using their suggestions and played with the code for hours and still do not get the desired results. When I tab OR click into any cell in column “C” titled “Event”, I want my UserForm17 to pop up. The UserForm has a ComboBox1 that contains a list of 25 events that they can select one of and it will appear in the selected cell. Due to the limitations of Data Validation option (font size, list length etc. – we are dealing with folks in their 60+ that can’t read the small font and aren’t real up on computer stuff) so that is why I am shooting for a UserForm solution. I am using Excel 2010 and Windows 10. I have the UserForm and combobox built already. Here is my latest attempt;

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error Resume Next

If Target.Name.Name = "Event" Then UserForm17.Show

On Error GoTo 0

 End Sub
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,158
try this:

Code:
Option Explicit
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Selection.Count = 1 Then
       If Target.Column = 3 And Target.Value = "Event" Then
            UserForm17.Show
        End If
    End If
End Sub

hth,
Ross
 

RicnGean

New Member
Joined
Dec 8, 2019
Messages
10
Office Version
  1. 2010
Platform
  1. Windows
Pasted the code into the sheet tab "view code" where the cells I am working with are but when I click on any cell in column "C" nothing happens.
 

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,158
try this.
start new excel file.
right click - view code

paste this in:
Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Selection.Count = 1 Then
       If Target.Column = 3 And Target.Value = "Event" Then
            MsgBox "cell selected"
        End If
    End If
End Sub

put the word Event in cell C7.

if you click anywhere on the sheet nothing happens until you click on cell C7. then a msgbox should appear.
 

RicnGean

New Member
Joined
Dec 8, 2019
Messages
10
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

Did as you suggested but when I click C7 nothing happens except the cell is selected with the cursor flashing.
 

RicnGean

New Member
Joined
Dec 8, 2019
Messages
10
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

Got it to open the "msg" box, but now how do I get it to open the box no matter which "C" cell I click on
 

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,158
Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Selection.Count = 1 Then
       If Target.Column = 3  Then
            MsgBox "cell selected"
        End If
    End If
End Sub
 

RicnGean

New Member
Joined
Dec 8, 2019
Messages
10
Office Version
  1. 2010
Platform
  1. Windows
I went with your first code and just replaced the "Event" with "" and the 'MsgBox' etc. with 'UserForm.Show' but now I can't get the ComboBox to show the list of events without clicking the Grey down arrow first. I would like the list to just show immediately when the Form pops up. any suggestions?
 

RicnGean

New Member
Joined
Dec 8, 2019
Messages
10
Office Version
  1. 2010
Platform
  1. Windows
Ross, thank you very much for your excellent help. I worked with my entire program until late last night and except for a few cosmetic tweaks it is ready for use. You guys that do this are all super and those of us not so tech savvy sure appreciate the assistance you give. Thanks again.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,107
Messages
5,622,780
Members
415,927
Latest member
vedasinternational

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top