+ Reply to Thread
Results 1 to 2 of 2

How to block Merge Function?

  1. #1
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    214

    How to block Merge Function?

    I want to allow users limited ability to format cell fonts, borders and fill.

    I execute the following command: Application.CommandBars.ExecuteMso "FormatCellsDialog" from a custom context menu, but the Merge cells option is there.

    I don't want to allow users to see or use the Merge cells feature.

    The only choices I know of are these:
    1. Prevent users from selecting more than 1 cells
    2. Unmerge cells if the cells are merged - I can't use this, as merging cells ruins the format and contents of some of the cells in the merged area that can't be fixed.
    3. Application.Undo - I can't get this to work. I run the following code:

    Please Login or Register  to view this content.
    and it errors out.

    So in other words, the only real option I know of, is option 1. Is there a better solution? Ideally I just want a smaller set of format options. Thanks!!

  2. #2
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    2016
    Posts
    214

    Re: How to block Merge Function?

    Another option is to split out the different format menus:
    Application.CommandBars.ExecuteMso "FormatCellsFontDialog" (does not include the merge option)
    Application.CommandBars.ExecuteMso "NumberFormatsDialog"

    If someone can tell me what the commandbar names for fill and borders, that would also solve the problem, because then I can let users format cells without the merge option. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Block Save As function from Excel
    By Nisar.mohammed in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2015, 10:25 AM
  2. Sum/IF function resulting to calculation of block of cells
    By managingcrap in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-03-2014, 10:30 PM
  3. [SOLVED] Defined Function: Compile Error Block If without End If
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2014, 07:12 AM
  4. Replies: 5
    Last Post: 10-09-2012, 10:44 AM
  5. Replies: 2
    Last Post: 06-22-2010, 07:55 AM
  6. Merge cell contents into a text block?
    By satori in forum Excel General
    Replies: 3
    Last Post: 10-31-2008, 07:32 PM
  7. Mail Merge creates a space in the address block
    By Crazy for Home Loans in forum Excel General
    Replies: 1
    Last Post: 07-20-2005, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1