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
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
Did as you suggested but when I click C7 nothing happens except the cell is selected with the cursor flashing.
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

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
Back
Top