Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Find Address of merged range VBA

I am trying to return the address of the top left cell in a merged
range. thsi is what I have so far and it is not even close to right.

Set Rng = Range("A52:BS52").Find(what:=ComboBox1.Text,
lookat:=xlWhole, _
Searchdirection:=xlPrevious, MatchCase:=False)

MsgBox Rng.MergeArea.Resize(1, 1).Address

Thanks,
Jay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Find Address of merged range VBA

Jay,

If Rng.MergeCells Then
MsgBox Rng.MergeArea.Cells(1, 1).Address
Else
MsgBox Rng.Cells(1, 1).Address
End If

HTH,
Bernie
MS Excel MVP


"jlclyde" wrote in message
...
I am trying to return the address of the top left cell in a merged
range. thsi is what I have so far and it is not even close to right.

Set Rng = Range("A52:BS52").Find(what:=ComboBox1.Text,
lookat:=xlWhole, _
Searchdirection:=xlPrevious, MatchCase:=False)

MsgBox Rng.MergeArea.Resize(1, 1).Address

Thanks,
Jay



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Find Address of merged range VBA


If Rng.MergeCells Then
MsgBox Rng.MergeArea.Cells(1, 1).Address
Else
MsgBox Rng.Cells(1, 1).Address
End If

HTH,
Bernie
MS Excel MVP

Bernie,
After closer inspection it is nto finding the value from the combobox1
in merged cells. I realize now that I have to tell it to find in rows
52 through 54. Then it works perfectly. You got me pushed in the
right direction though.

Thanks,
Jay

If UCase(Right(Left(ComboBox1.Text, 5), 3)) = "RUN" Or _
ComboBox1.Text = "UpComing Kluge" Then
Set Rng = Range("A52:BS54").Find(what:=ComboBox1,
lookat:=xlWhole, _
Searchdirection:=xlPrevious, MatchCase:=False)
Else
Set Rng = Range("A2:FK2").Find(what:=ComboBox1,
lookat:=xlWhole, _
Searchdirection:=xlPrevious, MatchCase:=False)
End If

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
How to create a range address with ADDRESS function? Steve McLeod Excel Worksheet Functions 1 December 18th 08 02:02 PM
find last cell in range with data, display cell address sevi61 Excel Worksheet Functions 14 October 29th 07 08:36 PM
How to find the address of the min cell within a range Will Excel Worksheet Functions 2 May 17th 07 08:45 PM
my merged address labels are only printing ONE page -- answer? Michelle Excel Discussion (Misc queries) 0 November 7th 05 08:04 AM
Deleting Range name's listed in the range address box. Satnam Patel Excel Discussion (Misc queries) 4 May 5th 05 01:42 PM


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

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

About Us

"It's about Microsoft Excel"