We have a spreadsheet linking into our sql databse. We bring out order rows. We sort by order number. If we want to put a blank row after every new order number is there a way to do this?
Take this as an example:
In the database below, I want to a row to be inserted before every Row where the credit class is "I". Can this be done with the help of a macro? Pls help
CR. CLASS A/c No. Amnt Status
I 1280021514 2431500 active
G 1280035621 3454353 not active
G 3580026521 3454387 active
G 9580025141 9879898 not active
S 1280049936 3621548 not active
D 3580026214 242342 not active
I 8880022221 4334355 active
P 1218005075 34544 not active
Q 1597999218 44414 not active
Q 1977997360 495694 not active
I 2357996503 54724 active
R 2737994645 59879 not active
I 3117993788 65034 not active
R 4564564564 701 active
R 8564564564 75344 not active
The macro would be:
Sub InsertRow()
'
Application.ScreenUpdating = False
Dim FOUND As Range
Dim firstR As Integer
Set FOUND = Cells.Find(What:="I", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
Let firstR = FOUND.Row + 1
Do
FOUND.Activate
FOUND.EntireRow.Insert
Set FOUND = Cells.Find(What:="I", After:=ActiveCell.Offset(1, 0), LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
I have crested a spreadsheet with a column with a mixture of letters in, however I get an error in the macro. This is my macro so i cannot see where the problem is
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.