Hi John
In this codeIn the file that works, daRow evaluates to 15 and all your coma delimited cells are within that range...so it works. In the file that doesn't work, daRow evaluates to 87 and all the coma delimited cells fall outside that range and aren't getting evaluated.![]()
Sub CountCommas() Sheets("Expanded").Select daRow = Application.CountA(ActiveSheet.Range("A:A")) For Z = 1 To daRow 'How many rows to work on daSting = Cells(Z, 1) 'Get string stringLen = Len(daSting) 'Length of String For X = 1 To stringLen 'Increment thru Select Case Mid(daSting, X, 1) Case "," 'If it is a comma daAnsw = daAnsw + 1 'Add 1 to list Case Else 'Do nothing End Select Next Cells(Z, 25) = daAnsw 'Write the answer daAnsw = 0 'Reset counter Next Call InsertRows End Sub
Welcome to the Forum!
Bookmarks