Noopur Suba
New Member
Hello,
I have used following VBA code in attached sheet.
I have one issue - in the sheet - tab 4 - you can see in column C copied from source have strikethrough cells. Here on applying above VBA code - I am getting error such that few strikethrough cells are not being counted because in the source sheet these cells are strikedout automatically through some other formula. Kindly help me resolving this error in a way that CountNostrike work properly without having formatting issue. Thanks
I have used following VBA code in attached sheet.
Code:
Public Function CountNoStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
If Not pRng.Font.Strikethrough And pRng = 1 Then
xOut = xOut + 1
End If
Next
CountNoStrike = xOut
End Function
I have one issue - in the sheet - tab 4 - you can see in column C copied from source have strikethrough cells. Here on applying above VBA code - I am getting error such that few strikethrough cells are not being counted because in the source sheet these cells are strikedout automatically through some other formula. Kindly help me resolving this error in a way that CountNostrike work properly without having formatting issue. Thanks
Attachments
Last edited by a moderator: