Have a look at this event code which you can refine.
No error-checking for data in the selected range...........assumes the
mergerange is empty when selected.
Runs when a value is selected from Combobox1
Private Sub ComboBox1_Change()
Set srng = Application.InputBox(prompt:= _
"Select A Range", Type:=8)
With srng
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.MergeCells = True
.Value = ComboBox1.Value
End With
End Sub
Gord Dibben MS Excel MVP
Thanks Gord. It going in the right direction.
What I finally looking for is the user has to set two combo values and
one toggle button value (Y/N) and that this string (value A, value B
and Y/N) is populated in a cell range, merged and centered.
It is possible to set the mouse selection without the "Set a range"
inputbox? So the user select the cells and a command only performs the
population process based on the chosen values.
Bart