ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Number of cells in merged cell (https://www.excelbanter.com/excel-programming/411045-number-cells-merged-cell.html)

Brad

Number of cells in merged cell
 
Thanks for taking the time to read my quetion.

I am trying to determine how many rows and columns are in my merged cell.

I can't seem to figure out how to do that.

I'm working with
If ActiveCell.MergeCells then
which tells me if the current cell is a merged one, but I can't get anything
else to work that will tell me how many cells are involved in the merge.

Thanks,

Brad

Gary Keramidas

Number of cells in merged cell
 

maybe this is what you want

activecell.MergeArea.Count
--


Gary


"Brad" wrote in message
...
Thanks for taking the time to read my quetion.

I am trying to determine how many rows and columns are in my merged cell.

I can't seem to figure out how to do that.

I'm working with
If ActiveCell.MergeCells then
which tells me if the current cell is a merged one, but I can't get anything
else to work that will tell me how many cells are involved in the merge.

Thanks,

Brad




Dave Peterson

Number of cells in merged cell
 
With ActiveCell.MergeArea
MsgBox .Rows.Count & vbLf & .Columns.Count & vbLf & .Address(0, 0)
End With

Brad wrote:

Thanks for taking the time to read my quetion.

I am trying to determine how many rows and columns are in my merged cell.

I can't seem to figure out how to do that.

I'm working with
If ActiveCell.MergeCells then
which tells me if the current cell is a merged one, but I can't get anything
else to work that will tell me how many cells are involved in the merge.

Thanks,

Brad


--

Dave Peterson

Brad

Number of cells in merged cell
 
Sheer Genius!!

Thanks Dave.

I got as far as getting the address of the MergeArea, but couldn't figure
out how to get the number of rows and columns. I was contemplating using the
address as a string and converting the letters to numbers etc. You way is
much better!

Thanks again.

Brad

"Dave Peterson" wrote:

With ActiveCell.MergeArea
MsgBox .Rows.Count & vbLf & .Columns.Count & vbLf & .Address(0, 0)
End With

Brad wrote:

Thanks for taking the time to read my quetion.

I am trying to determine how many rows and columns are in my merged cell.

I can't seem to figure out how to do that.

I'm working with
If ActiveCell.MergeCells then
which tells me if the current cell is a merged one, but I can't get anything
else to work that will tell me how many cells are involved in the merge.

Thanks,

Brad


--

Dave Peterson


Brad

Number of cells in merged cell
 
Hi Dave,

I'm trying to implement this using Cells(row,col).MergeArea, but it's not
working.

I really need to use Cells() and I don't want to set ActiveCell = Cells()
as I don't want to see the screen move all over the place.

Can this be done?

Brad

"Dave Peterson" wrote:

With ActiveCell.MergeArea
MsgBox .Rows.Count & vbLf & .Columns.Count & vbLf & .Address(0, 0)
End With

Brad wrote:

Thanks for taking the time to read my quetion.

I am trying to determine how many rows and columns are in my merged cell.

I can't seem to figure out how to do that.

I'm working with
If ActiveCell.MergeCells then
which tells me if the current cell is a merged one, but I can't get anything
else to work that will tell me how many cells are involved in the merge.

Thanks,

Brad


--

Dave Peterson


Brad

Number of cells in merged cell
 
I just found my mistake. No more issue.

Thanks again Dave,

Brad

"Brad" wrote:

Hi Dave,

I'm trying to implement this using Cells(row,col).MergeArea, but it's not
working.

I really need to use Cells() and I don't want to set ActiveCell = Cells()
as I don't want to see the screen move all over the place.

Can this be done?

Brad

"Dave Peterson" wrote:

With ActiveCell.MergeArea
MsgBox .Rows.Count & vbLf & .Columns.Count & vbLf & .Address(0, 0)
End With

Brad wrote:

Thanks for taking the time to read my quetion.

I am trying to determine how many rows and columns are in my merged cell.

I can't seem to figure out how to do that.

I'm working with
If ActiveCell.MergeCells then
which tells me if the current cell is a merged one, but I can't get anything
else to work that will tell me how many cells are involved in the merge.

Thanks,

Brad


--

Dave Peterson



All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com