Thread: Macro Help
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Macro Help

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long
Dim cell As Range
Dim sh As Worksheet

Application.ScreenUpdating = False

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 3 Step -1
If .Cells(i, TEST_COLUMN).Value \ 10000 < _
.Cells(i - 1, TEST_COLUMN).Value \ 10000 Then
.Rows(i).Insert
End If
Next i

End With

Application.ScreenUpdating = True

End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Mike" wrote in message
...
Hello,
Could someone please help me with a macro that will insert a row between
Groups
of Numbers. I would like to be able to insert a row between =10000 and
<=19999,
=20000 and <=29999, =30000 and <=39999, =40000 and <=49999, =50000
and<=59999 and so on upto 100000. I export this from Quickbooks and have
to insert rows manually


Thanks in advance for any help

Vender Parts UPC Item Description QTY
11003
15002
17000
18000
19000
19999
20000
21000
25000
26000
26010