Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Find Merged-cells

Hi All.......
The F5-Goto feature works well for what it does. It does not allow finding
of MergedCells.......Is it possible to do this by code?......either
highlighting or changing the background color.....and then maybe being able
to reverse them back to the previous colors?

TIA
Vaya con Dios,
Chuck, CABGx3


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Find Merged-cells

This will find and color all merged cells:

Sub FindMerge()
Dim rsel As Range, r As Range
Set rsel = Nothing
For Each r In ActiveSheet.UsedRange
If r.MergeCells = True Then
If rsel Is Nothing Then
Set rsel = r
Else
Set rsel = Union(rsel, r)
End If
End If
Next

If rsel Is Nothing Then
Else
rsel.Interior.ColorIndex = 3
End If
End Sub

--
Gary''s Student - gsnu2007L


"CLR" wrote:

Hi All.......
The F5-Goto feature works well for what it does. It does not allow finding
of MergedCells.......Is it possible to do this by code?......either
highlighting or changing the background color.....and then maybe being able
to reverse them back to the previous colors?

TIA
Vaya con Dios,
Chuck, CABGx3



  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Find Merged-cells

OUTSTANDING!!!.........that will do me just fine......thank you very much
Gary"s Student.

Vaya con Dios,
Chuck, CABGx3


"Gary''s Student" wrote in message
...
This will find and color all merged cells:

Sub FindMerge()
Dim rsel As Range, r As Range
Set rsel = Nothing
For Each r In ActiveSheet.UsedRange
If r.MergeCells = True Then
If rsel Is Nothing Then
Set rsel = r
Else
Set rsel = Union(rsel, r)
End If
End If
Next

If rsel Is Nothing Then
Else
rsel.Interior.ColorIndex = 3
End If
End Sub

--
Gary''s Student - gsnu2007L


"CLR" wrote:

Hi All.......
The F5-Goto feature works well for what it does. It does not allow
finding
of MergedCells.......Is it possible to do this by code?......either
highlighting or changing the background color.....and then maybe being
able
to reverse them back to the previous colors?

TIA
Vaya con Dios,
Chuck, CABGx3





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 find in merged cells Antonio Excel Programming 10 August 6th 07 05:58 PM
Find range of merged cells mcphc Excel Programming 2 February 1st 07 09:37 AM
Find Merged Cells Mike Rogers Excel Discussion (Misc queries) 5 December 6th 06 12:24 AM
how can I find merged cells in a large xl-file tvanellen Excel Discussion (Misc queries) 5 May 8th 06 01:02 AM
find and demerge merged cells jeromek Excel Programming 1 November 27th 04 05:05 PM


All times are GMT +1. The time now is 12:41 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"