Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default How to find cell with specific format?

I want to speed up my select procedure. Is there any VBA method or
Excel function to find specified format (MergedCells in my case) in
Cells range?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How to find cell with specific format?

I found this in the VBA help menu.

Set ma = Range("a3").MergeArea
If Range("a3").MergeCells Then
ma.Cells(1, 1).Value = "42"
End If


Letting VBA search a range is always faster than indexing rows and columns.
I usually do this

Set Myrange = Range("A1:Z:50)
For each MyCell in Myrange

Next MyCell



"NOPIK" wrote:

I want to speed up my select procedure. Is there any VBA method or
Excel function to find specified format (MergedCells in my case) in
Cells range?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to find cell with specific format?

If you're using xl2002+, the Edit|Find has been enhanced to look for
formating--including merged cells (in my little test).

I'm not sure what you're doing, but this may help (for xl2k and below):

How about a little macro:

Option Explicit
Sub testme()

Dim myCell As Range
Dim resp As Long

For Each myCell In ActiveSheet.UsedRange.Cells
If myCell.MergeCells Then
If myCell.Address = myCell.MergeArea(1).Address Then
resp = MsgBox(prompt:="found: " _
& myCell.MergeArea.Address & vbLf & _
"Continue looking", Buttons:=vbYesNo)
If resp = vbNo Then
Exit Sub
End If
End If
End If
Next myCell

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


NOPIK wrote:

I want to speed up my select procedure. Is there any VBA method or
Excel function to find specified format (MergedCells in my case) in
Cells range?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default How to find cell with specific format?

Thanks, people. At the moment I use
Reslt=.Find "Context data"
if Reslt.MergeCells then SearchSucceed
so I wanted much safer way, than relate on user affected context
(search is in deep loop and I can't sacrifice speed to use walk by
range, anyway it perfomed, if context data not found in range).

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
Find cells with a specific character in them and conditionally format cell RITCHI Excel Programming 2 February 11th 07 01:20 PM
UDF code to find specific text in cell comments, then average cell values bruch04 Excel Programming 3 December 5th 05 10:01 PM
How can I find and format specific cells automatically in Excel? Amy Excel Worksheet Functions 1 August 6th 05 03:00 PM
Find a row and a specific cell in that row Glenn P Excel Programming 5 June 11th 05 05:12 AM
use find twice to find cell on a specific row captbluefin[_6_] Excel Programming 2 November 1st 03 08:22 PM


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