Guest User

Untitled

a guest
Feb 8th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Sub Delete_Non_Number_Rows()
  2.  
  3. ' Dimension variables.
  4. I = 1
  5. Set xRng = Selection
  6.  
  7. ' Loop once for every row in the selection.
  8. For xCounter = 1 To xRng.Rows.Count
  9.  
  10. ' If it's no numeric, then...
  11. If Not IsNumeric(xRng.Cells(I)) Then
  12.  
  13. ' ...delete an entire row of cells.
  14. xRng.Cells(I).EntireRow.Delete
  15.  
  16. ' Otherwise...
  17. Else
  18.  
  19. ' ...increment I by one so we can cycle through range.
  20. I = I + 1
  21.  
  22. End If
  23.  
  24. Next xCounter
  25.  
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment