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,664
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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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