Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've narrowed it down with this change:
Dim a, b, c As String a = "(" b = "?????" c = ")" FindWhat = a & b & c ...and changed the line: Pos = InStr(ActiveCell.Value, a) But then I'll have to know how many digits in the number beforehand. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See my suggestion.
Regards, Tom Ogilvy "brym" wrote in message ... I've narrowed it down with this change: Dim a, b, c As String a = "(" b = "?????" c = ")" FindWhat = a & b & c ..and changed the line: Pos = InStr(ActiveCell.Value, a) But then I'll have to know how many digits in the number beforehand. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
brym
Try this sub Sub FindPar() Dim FndRng As Range Dim FirstAdd As String Dim StartPos As Long Dim EndPos As Long Dim i As Long Dim AllNumbers As Boolean Const WhatStart As String = "(" Const WhatEnd As String = ")" Set FndRng = Cells.Find(WhatStart, , , xlPart) If Not FndRng Is Nothing Then FirstAdd = FndRng.Address Do StartPos = InStr(1, FndRng.Value, WhatStart) EndPos = InStr(StartPos, FndRng.Value, WhatEnd) If EndPos 0 Then AllNumbers = True For i = StartPos + 1 To EndPos - 1 If Not IsNumeric(Mid(FndRng.Value, i, 1)) Then AllNumbers = False Exit For End If Next i If AllNumbers Then FndRng.Characters(StartPos, EndPos - StartPos + 1).Font.Bold = True End If End If Set FndRng = Cells.FindNext(FndRng) Loop Until FndRng.Address = FirstAdd End If End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "brym" wrote in message ... I've narrowed it down with this change: Dim a, b, c As String a = "(" b = "?????" c = ")" FindWhat = a & b & c ..and changed the line: Pos = InStr(ActiveCell.Value, a) But then I'll have to know how many digits in the number beforehand. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax for 'search' in Horizontal range? XL2007 | Excel Worksheet Functions | |||
Deleting a range of rows based on a variable; syntax error | Excel Discussion (Misc queries) | |||
macro syntax for selecting variable range | Excel Discussion (Misc queries) | |||
VBA Syntax for using a variable in a worksheet function | Excel Discussion (Misc queries) | |||
Syntax for variable search | Excel Programming |