LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Referencing Merged Cells in VBA

I am in a situation where I am having to reference merged cells in VBA. The
source of the data is not something I would have any control over or input
into.

This is a code sample I am using:

r1.Offset(0, 1).Value * r1.Offset(0, 2).MergeArea(1, 1).Value

r1.offset(0,1) is not a merged cell but r1.offset(0,2) should usually be a
merged cell. I suppose it might not be on occasion, but that is not the case
yet.

Any caveats or other suggestions would be appreciated.

In my limited testing, .MergeArea(1,1) returns the data, whether or not the
cell is a merged cell.

Thanks.



--ron
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with pasting special merged cells to merged cells ritpg[_2_] Excel Programming 3 March 9th 10 07:14 PM
Referencing text in merged cells Woofaloo Excel Worksheet Functions 1 August 19th 09 06:27 PM
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
Referencing a Merged cell Mariano Excel Discussion (Misc queries) 4 January 31st 06 02:28 PM
Sorting merged cellsHow do I sort merged cells not identically siz Laval Excel Worksheet Functions 1 November 3rd 04 09:40 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"