Cell properties dialog

J

Jos Vens

Hi,

I'd like to know how I can show the Cell-properties dialog from within VBA?

As my sheet is protected, the cell properties-item is disabled (greyed out)
in the format-menu. But, in a button, I could unprotect the sheet, then
show the dialog, and afterwards, protect again. Or isn't it that simple?

Thanks
Jos Vens
 
J

Jim Rech

I don't know of any reason your approach shouldn't work.

CommandBars.FindControl(, 855).Execute

--
Jim
| Hi,
|
| I'd like to know how I can show the Cell-properties dialog from within
VBA?
|
| As my sheet is protected, the cell properties-item is disabled (greyed
out)
| in the format-menu. But, in a button, I could unprotect the sheet, then
| show the dialog, and afterwards, protect again. Or isn't it that simple?
|
| Thanks
| Jos Vens
|
|
 
T

Tom Ogilvy

Change the takefocusonclick property of the commandbutton to false:

Private Sub CommandButton1_Click()
Me.Unprotect
CommandBars("Cell").ShowPopup
Me.Protect
End Sub
 
J

Jos Vens

Hi guys,

both options are valuable for me! I wonder how I can know the different
numbers to show other menu's/dialogs, like Jim did? Is there a list or
something?

Thanks a lot for your effort!
Jos
 
J

Jim Rech

There's only a couple thousand so I memorized them.<g> Actually I was
wishing for a quick and easy way but I used this code in the Immediate
window:

?Commandbars("Format").Controls(1).Id



--
Jim
| Hi guys,
|
| both options are valuable for me! I wonder how I can know the different
| numbers to show other menu's/dialogs, like Jim did? Is there a list or
| something?
|
| Thanks a lot for your effort!
| Jos
|
| "Tom Ogilvy" <[email protected]> schreef in bericht
| | > Change the takefocusonclick property of the commandbutton to false:
| >
| > Private Sub CommandButton1_Click()
| > Me.Unprotect
| > CommandBars("Cell").ShowPopup
| > Me.Protect
| > End Sub
| >
| > --
| > Regards,
| > Tom Ogilvy
| >
| > | >> Hi,
| >>
| >> I'd like to know how I can show the Cell-properties dialog from within
| > VBA?
| >>
| >> As my sheet is protected, the cell properties-item is disabled (greyed
| > out)
| >> in the format-menu. But, in a button, I could unprotect the sheet,
then
| >> show the dialog, and afterwards, protect again. Or isn't it that
simple?
| >>
| >> Thanks
| >> Jos Vens
| >>
| >>
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top