Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
find entire cell value
I can not find the true sum count per row occurence when using values
less than 10 in A1 and B1 such as 3, 16 or when using 1, 2 VBA works fine when A1 and B1 are higher than 10 such as 31, 35 or even 10,11 Sub GetCount() Dim No1 As Single Dim No2 As Single Dim NumberOfRows As Single Dim RowRange As Range Dim Count As Single Dim Counter As Integer No1 = [A1] No2 = [B1] NumberOfRows = Range("B3", Range("B" & Rows.Count). _ End(xlUp).Address).Rows.Count Count = 0 Set RowRange = Range("B3", "G3") For Counter = 1 To NumberOfRows If Not (RowRange.Find(No1) Is Nothing) = True And _ Not (RowRange.Find(No2) Is Nothing) = True Then _ Count = Count + 1 Set RowRange = RowRange.Offset(1) Next MsgBox "Number of occurrences is: " & Count End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
find entire cell value
What if your find looks like this:
Find(What := No1,LookAt :=xlWhole) hth, Doug "smandula" wrote in message oups.com... I can not find the true sum count per row occurence when using values less than 10 in A1 and B1 such as 3, 16 or when using 1, 2 VBA works fine when A1 and B1 are higher than 10 such as 31, 35 or even 10,11 Sub GetCount() Dim No1 As Single Dim No2 As Single Dim NumberOfRows As Single Dim RowRange As Range Dim Count As Single Dim Counter As Integer No1 = [A1] No2 = [B1] NumberOfRows = Range("B3", Range("B" & Rows.Count). _ End(xlUp).Address).Rows.Count Count = 0 Set RowRange = Range("B3", "G3") For Counter = 1 To NumberOfRows If Not (RowRange.Find(No1) Is Nothing) = True And _ Not (RowRange.Find(No2) Is Nothing) = True Then _ Count = Count + 1 Set RowRange = RowRange.Offset(1) Next MsgBox "Number of occurrences is: " & Count End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
find entire cell value
Thank's ever so much for the assistance.
Your solution works like a charm. Thank's again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EXCEL function;find string in entire column & return cell referenc | Excel Worksheet Functions | |||
Find and Replace formatting formats the ENTIRE cell | Excel Discussion (Misc queries) | |||
Use find to select entire rows with a cell with that value | Excel Worksheet Functions | |||
find a specific cell from the entire worksheet | Excel Worksheet Functions | |||
macro to find date format in a cell and delete that entire row | Excel Programming |