Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find cells with a specific character in them and conditionally format cell | Excel Programming | |||
UDF code to find specific text in cell comments, then average cell values | Excel Programming | |||
How can I find and format specific cells automatically in Excel? | Excel Worksheet Functions | |||
Find a row and a specific cell in that row | Excel Programming | |||
use find twice to find cell on a specific row | Excel Programming |