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

On Sun, 09 May 2010 08:54:26 -0400, GS wrote:

Hi Ron,

Just want to confirm what you already state you just discovered: -the
ref address of a merged area is always the first (top left) cell in the
group. You're going to have some unexpected results when working with
merged cells, depending on what your code is doing with them. What's
important about working with DATA in merged cells is the ref address.


Thank you for confirming that. I made my "discovery" empirically and it's good
to have confirmation.

Also, depending on why the cells are merged, there may be other ways to
show data with using Alignment settings. This avoids having to work
with merged cells in a single row. (i.e.: Center across selection,
Distributed)


The Excel sheets are coming from a gov't source over which I have zero
control/input/influence/etc. So although there may be other, equally effective
methods of displaying the data, I don't really have any choice other than to
deal with the data as presented. I suppose I could write a routine to reformat
the information, but I doubt that would be any easier than to just handle it
directly.

For example, in the data, E14:E16 is a merged cell, as is H14:H16.

The separate lines of data in F14, F15 and F16 each refer to the data in the
merged cells on either side.

--ron
Reply
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 02:28 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"