Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Merge cells using macro
NumRows = 1
NumCols = 2 With Range("A4").Resize(NumRows,NumCols) .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .ShrinkToFit = False .MergeCells = True End With Regards, Tom Ogilvy "Amy" wrote in message ... I am trying to merge some cells using a macro. I'm successful when using the command: Range("A4:A5").select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .ShrinkToFit = False .MergeCells = True End With However, the range of cells I want to merge is different everytime, so I would like the macro to be able to count the number of cells to be merged (some command that allows definig a range using relative cell reference). Thanks, Amy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Merge /Update Macro | Excel Discussion (Misc queries) | |||
Merge Macro | Excel Discussion (Misc queries) | |||
Merge cells with formula or macro? | Excel Discussion (Misc queries) | |||
Excel Macro - Merge Cells unavailable - Unable to figue out why. | Excel Worksheet Functions | |||
Mail Merge macro | Excel Discussion (Misc queries) |