Guest User

Untitled

a guest
Nov 20th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. one@example.com, two@example.com, three@example.com
  2.  
  3. one@example.com
  4. two@example.com
  5. three@example.com
  6.  
  7. if (cell contains ", ")
  8. get string from ", " to ", " and paste somehow
  9. else "b1"
  10.  
  11. %s/,/\n/g
  12.  
  13. Cells(1, 1).Select
  14. Dim curr As String
  15. Dim cnt As Integer
  16. cnt = 0
  17. For i = 1 To ActiveCell.SpecialCells(xlLastCell).Row
  18. curr = Cells(i, 1).Value
  19. If InStr(curr, "@") Then
  20. If InStr(curr, ",") Then
  21. Dim tmp() As String
  22. tmp = Split(curr, ",")
  23. For j = LBound(tmp) To UBound(tmp)
  24. cnt = cnt + 1
  25. Cells(cnt, 2).Value = tmp(j)
  26. Next
  27. Else
  28. cnt = cnt + 1
  29. Cells(cnt, 2).Value = curr
  30. End If
  31. End If
  32. Next i
Add Comment
Please, Sign In to add comment