ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data in f a Merged area (https://www.excelbanter.com/excel-programming/436742-re-data-f-merged-area.html)

FSt1

Data in f a Merged area
 
hi
no. when dealing with merged cell, you skew off into a totally different
concept.
note: i am totally opposed to using merged cells. dumbest thing excel
programers ever came up with. it may look pretty on the sheet but it screws
everthing else up.
so....stop using keywords that apply to unmerged cells(normal cells). use
keywords that do apply to merged cells. such as MergeCells...MergedArea. Oh!
didn't know about those. look them up in VB help.
to find merged cells on your sheet, use something like this.....
Sub isitmerged()
Dim c
For Each c In ActiveSheet.UsedRange
If c.MergeCells Then
MsgBox c.Address & " is merged"
End If
Next
End Sub
this does not solve your problem but does illistrate the problems created by
using merged cells. see note above.
to get the value of merged cells, make sure that all of the value are in the
upper left cell of the merged area. even though you see merged cells on the
sheet, excel is still seeing the grid and just making a side note about the
merged cells.
Sub whatisit()
Dim c As Range
Set c = Range("B2")
If c.MergeCells Then
mergedinfo = c.MergeArea
MsgBox c.Value
End If
End Sub

so once again, when using merged cells, even with vb, you are entering into
the...... "other" ......world.

in the long run, best not to even use merged cells. see note above.
if this doesn't make sense, do a google on merged cells to get more confused.

Regards
FSt1

"Bruce A. Julseth" wrote:

With VBA, how can I get the data for a merged area? I can reach a cell in
via "Offset" but don't know the boundaries and don't know the location of
Cell(1,1) of the merged area. Isn't the data located in Cell(1,1) of the
merged area?

Thanks for your help...


.


Bruce A. Julseth[_2_]

Data in f a Merged area
 
Thanks for the suggestions....I'm new to this stuff and didn't know about
the "Merge?????" procedures.

Thanks again.

"FSt1" wrote in message
...
hi
no. when dealing with merged cell, you skew off into a totally different
concept.
note: i am totally opposed to using merged cells. dumbest thing excel
programers ever came up with. it may look pretty on the sheet but it
screws
everthing else up.
so....stop using keywords that apply to unmerged cells(normal cells). use
keywords that do apply to merged cells. such as MergeCells...MergedArea.
Oh!
didn't know about those. look them up in VB help.
to find merged cells on your sheet, use something like this.....
Sub isitmerged()
Dim c
For Each c In ActiveSheet.UsedRange
If c.MergeCells Then
MsgBox c.Address & " is merged"
End If
Next
End Sub
this does not solve your problem but does illistrate the problems created
by
using merged cells. see note above.
to get the value of merged cells, make sure that all of the value are in
the
upper left cell of the merged area. even though you see merged cells on
the
sheet, excel is still seeing the grid and just making a side note about
the
merged cells.
Sub whatisit()
Dim c As Range
Set c = Range("B2")
If c.MergeCells Then
mergedinfo = c.MergeArea
MsgBox c.Value
End If
End Sub

so once again, when using merged cells, even with vb, you are entering
into
the...... "other" ......world.

in the long run, best not to even use merged cells. see note above.
if this doesn't make sense, do a google on merged cells to get more
confused.

Regards
FSt1

"Bruce A. Julseth" wrote:

With VBA, how can I get the data for a merged area? I can reach a cell
in
via "Offset" but don't know the boundaries and don't know the location of
Cell(1,1) of the merged area. Isn't the data located in Cell(1,1) of the
merged area?

Thanks for your help...


.





All times are GMT +1. The time now is 12:41 PM.

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