Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default merged cells problem

Hi folks,

Ok this is the problem
In column A cells 1 to 5 are merged and display a single
word which was originally in cell A1 but is now centered
vertically.
in column D cells 1 to 5 is a list of names. I need excel
to find the name and then display the word in Label1

So far I've used the find method successfully to locate
the name but have come unstuck on the next bit.

'Myname = the found name's address

label1.caption = range(Myname).end(xlToLeft).text
'(ie label1 displays range A 1-5 which ever correpsonds to
the found cell.

This works, but because range A1-5 is merged, the word is
only in range A1 so label1 displays nothing
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default merged cells problem

Hi Libby
This works for me:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox Target & [A1]
End Sub

whe
first five cells in column A are merged
first five cells in column D contain a different word each
this routine is placed in the Sheet1 object

When you click on a cell in column D a message appears showing the target
and what is in cell A1.


HTH
Andrew B



"Libby" < wrote in message ...
Hi folks,

Ok this is the problem
In column A cells 1 to 5 are merged and display a single
word which was originally in cell A1 but is now centered
vertically.
in column D cells 1 to 5 is a list of names. I need excel
to find the name and then display the word in Label1

So far I've used the find method successfully to locate
the name but have come unstuck on the next bit.

'Myname = the found name's address

label1.caption = range(Myname).end(xlToLeft).text
'(ie label1 displays range A 1-5 which ever correpsonds to
the found cell.

This works, but because range A1-5 is merged, the word is
only in range A1 so label1 displays nothing



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
Auto Row Height with Wrapped Text in Merged Cells Problem Rick Cl. Excel Discussion (Misc queries) 3 June 3rd 10 11:21 PM
Word wrap problem - Merged cells Helen Excel Discussion (Misc queries) 1 March 12th 09 05:39 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
Autofit with Merged Cells/Wrap Text Macro Problem elfmajesty Excel Discussion (Misc queries) 3 May 25th 06 06:32 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 07:51 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"