Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Reading Merged Cells

Hey guys,

And yes before the warnings come in i know working with merged cells is
difficult to say the least but there is no way around this one and my own
attempts to solve the problem have resulted in epic fails.

Anyhow, i have a workbook and in this workbook i have a sheet set up with
days of the week across the top and names down the left, i.e.


A B C D E
| mon | tue | wed | thur
name 1 in out off
--------------------------------------------
name 2 in in off
--------------------------------------------
name 3 off

OK not the best diagram but it will do, each column has been assigned its
own range i.e. RngMon = sheet1.range("B2:B4") so it can be read on its
particular day.

Rows 2 and 3 show 2 people in varying states during the week, the 3rd row
shows someone who is in 1 state for the entire week, this is shown by merging
all the cells on the row and centering the content, the only problem is, is
that when it comes to this particular cell the counter i have set up misses
the info in the meged cell.

I think this is because the actual text was entered in cell B4 (mon) and i
am trying to count it in cell D4 (wed) and obviously that cell doesnt hold a
value.

Does anyone know how to have a piece of code search a merged area? instead
of just reading the cell it is given, if it hits a cell thats part of a group
of merged cells then it will search all the cells in the merged area?

Any assistance would be greatly appreiciated.

Cheers,

The Noob.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Reading Merged Cells

When you merge cells all the data is in the 1st cell (upper left cell). It
may appear that the text is in other locations with formating, but the data
is really in the first cell. Your search range must include the 1st cell to
find the data.

"Noob McKnownowt" wrote:

Hey guys,

And yes before the warnings come in i know working with merged cells is
difficult to say the least but there is no way around this one and my own
attempts to solve the problem have resulted in epic fails.

Anyhow, i have a workbook and in this workbook i have a sheet set up with
days of the week across the top and names down the left, i.e.


A B C D E
| mon | tue | wed | thur
name 1 in out off
--------------------------------------------
name 2 in in off
--------------------------------------------
name 3 off

OK not the best diagram but it will do, each column has been assigned its
own range i.e. RngMon = sheet1.range("B2:B4") so it can be read on its
particular day.

Rows 2 and 3 show 2 people in varying states during the week, the 3rd row
shows someone who is in 1 state for the entire week, this is shown by merging
all the cells on the row and centering the content, the only problem is, is
that when it comes to this particular cell the counter i have set up misses
the info in the meged cell.

I think this is because the actual text was entered in cell B4 (mon) and i
am trying to count it in cell D4 (wed) and obviously that cell doesnt hold a
value.

Does anyone know how to have a piece of code search a merged area? instead
of just reading the cell it is given, if it hits a cell thats part of a group
of merged cells then it will search all the cells in the merged area?

Any assistance would be greatly appreiciated.

Cheers,

The Noob.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Reading Merged Cells

So there is no way of searching a merged area? you have to go to the first
cell in the group? thats going to make this a bit more difficult.

cheers bud, much appreiciated.

The Noob.

"Joel" wrote:

When you merge cells all the data is in the 1st cell (upper left cell). It
may appear that the text is in other locations with formating, but the data
is really in the first cell. Your search range must include the 1st cell to
find the data.

"Noob McKnownowt" wrote:

Hey guys,

And yes before the warnings come in i know working with merged cells is
difficult to say the least but there is no way around this one and my own
attempts to solve the problem have resulted in epic fails.

Anyhow, i have a workbook and in this workbook i have a sheet set up with
days of the week across the top and names down the left, i.e.


A B C D E
| mon | tue | wed | thur
name 1 in out off
--------------------------------------------
name 2 in in off
--------------------------------------------
name 3 off

OK not the best diagram but it will do, each column has been assigned its
own range i.e. RngMon = sheet1.range("B2:B4") so it can be read on its
particular day.

Rows 2 and 3 show 2 people in varying states during the week, the 3rd row
shows someone who is in 1 state for the entire week, this is shown by merging
all the cells on the row and centering the content, the only problem is, is
that when it comes to this particular cell the counter i have set up misses
the info in the meged cell.

I think this is because the actual text was entered in cell B4 (mon) and i
am trying to count it in cell D4 (wed) and obviously that cell doesnt hold a
value.

Does anyone know how to have a piece of code search a merged area? instead
of just reading the cell it is given, if it hits a cell thats part of a group
of merged cells then it will search all the cells in the merged area?

Any assistance would be greatly appreiciated.

Cheers,

The Noob.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Reading Merged Cells


Does anyone know how to have a piece of code search a merged area? instead
of just reading the cell it is given,


Say B2:D4 is merged but you want to look in C3. Obviously C3 will be empty
and the only cell in the merged area that can contain data is B2.

to get the data
myVal = Range("C3").MergeArea(1)

and if you need to know
mergedAddress = Range("C3").MergeArea.Address

Regards,
Peter T

"Noob McKnownowt" wrote in
message ...
Hey guys,

And yes before the warnings come in i know working with merged cells is
difficult to say the least but there is no way around this one and my own
attempts to solve the problem have resulted in epic fails.

Anyhow, i have a workbook and in this workbook i have a sheet set up with
days of the week across the top and names down the left, i.e.


A B C D E
| mon | tue | wed | thur
name 1 in out off
--------------------------------------------
name 2 in in off
--------------------------------------------
name 3 off

OK not the best diagram but it will do, each column has been assigned its
own range i.e. RngMon = sheet1.range("B2:B4") so it can be read on its
particular day.

Rows 2 and 3 show 2 people in varying states during the week, the 3rd row
shows someone who is in 1 state for the entire week, this is shown by
merging
all the cells on the row and centering the content, the only problem is,
is
that when it comes to this particular cell the counter i have set up
misses
the info in the meged cell.

I think this is because the actual text was entered in cell B4 (mon) and i
am trying to count it in cell D4 (wed) and obviously that cell doesnt hold
a
value.

Does anyone know how to have a piece of code search a merged area? instead
of just reading the cell it is given, if it hits a cell thats part of a
group
of merged cells then it will search all the cells in the merged area?

Any assistance would be greatly appreiciated.

Cheers,

The Noob.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Reading Merged Cells

Thanks for that guys, very much apprieciated, cheers.

The Noob.

"Peter T" wrote:


Does anyone know how to have a piece of code search a merged area? instead
of just reading the cell it is given,


Say B2:D4 is merged but you want to look in C3. Obviously C3 will be empty
and the only cell in the merged area that can contain data is B2.

to get the data
myVal = Range("C3").MergeArea(1)

and if you need to know
mergedAddress = Range("C3").MergeArea.Address

Regards,
Peter T

"Noob McKnownowt" wrote in
message ...
Hey guys,

And yes before the warnings come in i know working with merged cells is
difficult to say the least but there is no way around this one and my own
attempts to solve the problem have resulted in epic fails.

Anyhow, i have a workbook and in this workbook i have a sheet set up with
days of the week across the top and names down the left, i.e.


A B C D E
| mon | tue | wed | thur
name 1 in out off
--------------------------------------------
name 2 in in off
--------------------------------------------
name 3 off

OK not the best diagram but it will do, each column has been assigned its
own range i.e. RngMon = sheet1.range("B2:B4") so it can be read on its
particular day.

Rows 2 and 3 show 2 people in varying states during the week, the 3rd row
shows someone who is in 1 state for the entire week, this is shown by
merging
all the cells on the row and centering the content, the only problem is,
is
that when it comes to this particular cell the counter i have set up
misses
the info in the meged cell.

I think this is because the actual text was entered in cell B4 (mon) and i
am trying to count it in cell D4 (wed) and obviously that cell doesnt hold
a
value.

Does anyone know how to have a piece of code search a merged area? instead
of just reading the cell it is given, if it hits a cell thats part of a
group
of merged cells then it will search all the cells in the merged area?

Any assistance would be greatly appreiciated.

Cheers,

The Noob.






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
Copy paste non merged to merged cells [email protected] Excel Worksheet Functions 1 February 5th 09 05:25 PM
How can I sort an Excel Doc containing merged & non-merged cells? KellyH Excel Discussion (Misc queries) 11 June 10th 08 04:12 AM
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
how do i link merged cells to a merged cell in another worksheet. ibbm Excel Worksheet Functions 3 April 27th 06 11:40 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 05:35 PM.

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"