Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 20th, 2012  |  syntax: None  |  size: 0.48 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Excel create row macro
  2. Hello; Goodbye
  3.        
  4. Hello;
  5.    Goodbye
  6.        
  7. Dim r1 As Range, r2 As Range
  8. Dim saItem() As String
  9.  
  10.  
  11. For Each r1 In ActiveSheet.Range("A1", Cells(Application.Rows.Count, 2).End(xlUp))
  12.     If InStr(1, r1.Value2, ";") > 0 Then
  13.         saItem = Split(r1.Value2, ";")
  14.         r1 = Trim$(saItem(0)) & ";"
  15.         r1.Offset(1).Insert (xlDown)
  16.         r1.Offset(1) = Trim$(saItem(1))
  17.     End If
  18. Next r1
  19.        
  20. r1.Offset(1).Insert (xlDown)
  21.        
  22. r1.Offset(1).EntireRow.Insert (xlDown)