• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

merge cells with a short key

hoomantt

Member
Hi Dear Professors;
I want a Macro For Merge Cellsthat select with mouse drag with a short key(e.g Ctrl+Q),That they Are In A Column(Such as column A)
these cells just countains data in first cell.
for example i want to merge cells A5:A12 with Short Key (Ctrl + Q) that just there is one data in just first cell(A5) and there are not any data in othere cells with Select Cells And Click Short key (Ctrl+Q)
And if it possible , can do this :
When i Select First Cell (Like A5) and drag for select end cell (Like A12) ; when i unhand the right mouse key , with a macro do merge cells and dont need to click short key or ....
may it?
Thanks to every Professors...
 
Hi,

Check with attached file.

Short Key : Ctrl+Shift+q

Pls note : If you want to run the macro by pressing a keyboard shortcut key, enter a letter in the Shortcut key box. You can use CTRL+ letter (for lowercase letters) or CTRL+SHIFT+ letter (for uppercase letters), whereletter is any letter key on the keyboard. The shortcut key cannot use a number or special character, such as @ or #.

The shortcut key will override any equivalent default Microsoft Excel shortcut keys while the workbook that contains the macro is open.

http://office.microsoft.com/en-in/excel-help/run-a-macro-HP005202306.aspx
 

Attachments

  • Merge.xlsm
    13.5 KB · Views: 4
Avoid merging cells

Merged cells can help you arrange values in a meaningful way, but they come with problems -- numerous problems, big problems.

For instance, Excel won't apply column formats to a merged cell unless you select all the columns that comprise the merge.

In addition, not all cell formats, stick once you emerge a cell.

You can't sort a column with merged cells.

You can't even select a single-column range if there's a merged cell in it -- go ahead, try!, the whole column will become merged, not good.

You cannot put a filter on it. The problem is the filter is completely useless because the filter will groan with the "merged cells need to be identically sized." Warning, which in English means you have to make each group of merged cells the same size as the largest group. And you have to find them all!

Merging cells in columns and rows could lead to data loss, bad thing.

Formulas and Functions that refer to merged cells will not work, bad thing.

Don't hesitate to use merged cells if you really need them (you don’t), but they will limit what you can do to the cells and even the columns involved.

Center Across Selection is a far better alternative to merging.

To apply this format, select the cells you want to appear merged and then launch the Alignment group dialog, Ctrl + 1, and click the Alignment tab. Center Across Selection is in the Horizontal drop-down.

You will get the desired look you want but without the merged cell's problems.
 
Back
Top