![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Board Regular
Join Date: Apr 2002
Posts: 113
|
Anyone have code to properly insert a column when some of the cells are merged?
ie. - Record which merged cells cross the column(s) to insert. (Perhaps simply record all merged cells on the sheet.) - Unmerge all affected cells. - Insert the column(s). - Re-merge the affected cells, increasing the range of each merge to include the added columns. (I only need the macro to accomodate merges accross columns of a single row.) This has always annoyed me in Excel 97, but I have yet to take the time to create the above code. Alternatively, Is there a way to "Left Justify Accorss Section"? ie. I want my text to be able to wrap text, left justify accross several columns. This can be done with merged cells, but becaomes a pain whenever I want to add or a column. Also, autofit row height does not work properly accross merged cells so I usually add a hidden column of approriate width that is set equal to the merged cells. (A waste of space, but if there is a better way, please let me know.) WHY I ASK: I have a sheet to tracking tasks. The schedule dates work best as a horizontal table of narrow cells near the top of the page. The Detailed instructions and reference material are long paragraphs that are best in wide cell (thus the merged cells). Thanks, Brian Files can be mailed to BW-NoSPAM1@earthlink.net Example in html:
To see the formula in the cells just click on the cells hyperlink The above image was automatically generated by[HtmlMaker V1.25] If you want this code, click here and Colo will email the file to you This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#2 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Quote:
Here is a sample code I made.
HTH |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Posts: 113
|
Thanks Colo!
I'll give that a try. Brian |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi me again. I think, maybe you need to "delete" columns too.
Please copy this into a standard module. And run Sub AddRightClickMenu(). "MyInsert" and "MyDelete" menu will apper on your Right Click Menu. If you don't need the menu, please run Sub Reset().
HTH |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|