shrinivasshweta
New Member
- Joined
- Dec 29, 2016
- Messages
- 18
Code:
arr1 = Array("m", "n", "o", "p")
With Worksheets("Sheet1")
With .Range("B3", .Cells(Rows.Count, "M").End(xlUp))
celltxt1 = Sheet1.Range("b:b").Text
If InStr(1, celltxt1, " *abc* ") Then
'do nothing
Else: For Each cell In Range("M:M")
If cell.Value = vbNullString Then
'do nthing
Else:
For Each elem In arr1
a = a + WorksheetFunction.Sum(WorksheetFunction.CountIf(.Columns(7), elem))
Next elem
End If
Next cell
End If
End With
End With
I want to run this macro with the above logic.
There is no compile time error but i am getting the output as
a
0
I don;t know whats wrong with this logic.
Can someone please help me out?
Thank you so much in advance.
Last edited by a moderator: