SHARE
TWEET

Untitled

a guest Feb 18th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub TESTexample()
  2. Dim lastrow As Integer
  3. lastrow = Cells(Rows.Count, 1).End(xlUp).Row
  4. Dim lastcol As Integer
  5. lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
  6. Dim r As Integer
  7. Dim c As Integer
  8. For r = lastrow To 2 Step -1
  9. For c = lastcol To 3 Step -1If Cells(r, c) <> "" Then
  10. Rows(r + 1).Insert
  11. Cells(r + 1, 1) = Cells(r, 1)
  12. Cells(r + 1, 2) = Cells(r, c)
  13. Cells(r, c).Clear
  14. Else: Rows(r).Delete
  15. End If
  16. Next
  17. Next
  18. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top