I've a large task, which I'm splitting up into smaller pieces:
I'm trying to get VBA to output the number of plus signs in a cell (a workaround to how many other cells it adds into this cell).
I get an error on the substitute line on my small code. If all worked according to plan I'd have the number of plus signs regardless of how many letters on the cell.
I'm trying to get VBA to output the number of plus signs in a cell (a workaround to how many other cells it adds into this cell).
Code:
Sub TEST()
'
' Makro4 Makro
'
Dim MyString As String
Dim StringLength As Integer
MyString = ActiveCell
StringLength = Len(MyString) - Len(Substitute(MyString, "+", ""))
MsgBox StringLength
'
End Sub
I get an error on the substitute line on my small code. If all worked according to plan I'd have the number of plus signs regardless of how many letters on the cell.