Hello all so I am very new to VBA but have take some beginner classes in Java and HTML so I Almost know what I am doing.
So I have a cell in which I want to split based on a comma (,) and I want to count the number of occurrences of a certain Character and then display that result in another cell. Doing this while going down a column of these rows in that single column.
ex: y,y,y,n,y = in cell D6 : 4
Below is the bit of code I have generated with the little bit of information I have learned about VBA online.
(I tried to comment on the answer but dont have enough rep to do so)
And please when giving the answer try to explain the methods, I dont have an understanding of what each does, being both new to programming and VBA so in regaurds to your replies see if I am able to figure it out with a bit of a push.
Private Sub CommandButton15_Click()
Dim Number As String
Dim Yoccur As Integer
Dim Noccur As Integer
Dim Notapp As Integer
Dim length As Integer
Dim current As String
Dim i As Integer
Dim Row As Integer
Do While Row < 84
For i = 1 To length
'parse data into a array here
'tempArr = Split(X(lngRow, 2), ",")
' would that work if I tried to split based on the comma?
If current = "y" Then Yoccur = Yoccur + 1
If current = "n" Then Noccur = Noccur + 1
If current = "n/a" Then Notapp = Notapp + 1
Next i
Wend
Range("d45").Value = Yoccur
Range("d46").Value = Noccur
Range("d47").Value = Notapp
End Sub