Saif has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
VBA
How can I enter a line on the spreadsheet after each customer name?
RE: VBA
Hi Saif
Thank you for your question
First you need to sort the data by customer name.
You then need to move down the data a row at a time until the customer name changes. When that happens
Rows(intRowCount).Insert
Will insert a row in the relevant place.
Note inserting a row will disrupt the current region, and so you cannot use the count method to determine how many rows there are. I suggest
Do until cells(intRowCount,1).Value = ""
as a looping structure. The code will run until it encounters an empty cell.
Regards
Stephen