Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed with merged cells
Hello,
I am looping through cells in the range and I am trying to figure out whether the cell is a merged cell. If it is a merged cell, how many columns and rows the merged area includes? Thanks? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed with merged cells
Hi Frank,
I am looping through cells in the range and I am trying to figure out whether the cell is a merged cell. If it is a merged cell, how many columns and rows the merged area includes? With the following code you can check which cells are included in a merged range: Sub test() Dim c As Range, x As String For Each c In Range("A1:E10") If c.MergeCells Then x = x & c.Address(False, False) & ", " End If Next c MsgBox x End Sub Maybe it helps. -- Greetings, Monika Weber [Microsoft MVP für Excel] http://www.jumper.ch (Office Help Desk) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed with merged cells
Here's what you would have to test if it is merged and how many rows/columns
(assuming rng is your current "cell"/range): If rng.MergeCells Then MsgBox "rows=" & rng.MergeArea.Rows.Count & " cols=" & rng.MergeArea.Columns.Count End If -Erik "Frank Rizzo" wrote in message ... Hello, I am looping through cells in the range and I am trying to figure out whether the cell is a merged cell. If it is a merged cell, how many columns and rows the merged area includes? Thanks? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed with merged cells
Hi Frank,
I am looping through cells in the range and I am trying to figure out whether the cell is a merged cell. If it is a merged cell, how many columns and rows the merged area includes? With the following code you can check which cells are included in a merged range: Sub test() Dim c As Range, x As String For Each c In Range("A1:E10") If c.MergeCells Then x = x & c.Address(False, False) & ", " End If Next c MsgBox x End Sub Maybe it helps. -- Greetings, Monika Weber [Microsoft MVP für Excel] http://www.jumper.ch (Office Help Desk) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy paste non merged to merged cells | Excel Worksheet Functions | |||
How can I sort an Excel Doc containing merged & non-merged cells? | Excel Discussion (Misc queries) | |||
Autofit Merged cell Code is changing the format of my merged cells | Excel Discussion (Misc queries) | |||
how do i link merged cells to a merged cell in another worksheet. | Excel Worksheet Functions | |||
Sorting merged cellsHow do I sort merged cells not identically siz | Excel Worksheet Functions |