Combo box with a Yes or No drop but how do you make the Y a default always entered

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,663
Hello Alll,

How do you make a Yes No combo box always have the default answer as Yes appearing on a user form but still allow the user to change it to NO?

Thanks in advance for all ideas and suggestions.

Kurt
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

crimson_b1ade

Well-known Member
Joined
Sep 27, 2008
Messages
1,557
in your initialize statement, set the value of the combo box to the value that you want:

Code:
Private Sub UserForm_Initialize()
 
ComboBox1.Value = "Yes"

End Sub
 

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,663
Thanks crimson_blade that is what I thought it was, I just wanted to confirm.

It worked!!

Along the same lines if I want a cell to start always in cell Dt on a sheet named "Report", then I would have to enter the code in the initialize event of the open worksheet and then when a user form finishes where do I put the code to tell it to always point the cell pointer to cell D5 of a spreadsheet called "Report"?

Again thanks and I would love to hear the responses on this second question.

Kurt
 

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,663

ADVERTISEMENT

Hello Andrew and all,

Would it be something like this for the worksheet

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.Goto Worksheets("Report").Range("D5"), True
End Sub

Thanks for your help!

Kurt
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Do you want to prevent the user from selecting any cell other than D5 on that worksheet?

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.Goto Me.Range("D5"), True
End Sub
 

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,663

ADVERTISEMENT

Yes that would be the best way to go.
 

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,663
Hello Andrew and all,

That works yes, but I have a report that runs and I can't see it after it runs.

So should I put that line of code on the last line of where the report generates?

Thanks,

Kurt
 

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,663
Any ideas out there.

This works but I have a macro that clears the report on that sheet called Report.

Is there something that allows the sheet to shift but still keep the cell in D5?
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
What do you mean by "Is there something that allows the sheet to shift but still keep the cell in D5?"?
 

Watch MrExcel Video

Forum statistics

Threads
1,123,535
Messages
5,602,217
Members
414,513
Latest member
junbuggle

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