Well like everyone else, I am fairly new to this. I have an excel file that I am pulling information out of and putting in a new workbook. this is what I have it doing now to get everything in the order that I need it. I have the script to look in column c and find the size, copy that row , past that row to the bottom and then delete the row from the top (so it no longer is there, don’t need duplicates!)

I have all of that working but I also want the script to find how many rows there are per size and then if the row are less than twenty add a row with an asterisk in between the sizes so that it does equal 20.

there are 5 columns to the excel spreadsheet (product #, group, size, description and image name) I have tried to just sort the columns, but it does not put everything in the order that i need it.

here is the code that I have for sorting:

tell application “Microsoft Excel”

tell sheet 1 of workbook 1

set endOfRow to first row index of (get end (cell 1 of row (count rows)) direction toward the top)

repeat with i from endOfRow to 2 by -1

if value of (cell 3 of row i) = " " then

delete entire row of (cell 1 of row i)

end if

end repeat

set endOfRow to first row index of (get end (cell 1 of row (count rows)) direction toward the top)

repeat with i from endOfRow to 2 by -1

if value of (cell 3 of row i) = “00” then

copy range entire row of (cell 1 of row i)

insert into range row (endOfRow + 2) of sheet “Sheet1”

delete range entire row of (cell 1 of row i)

end if

end repeat

set endOfRow to first row index of (get end (cell 1 of row (count rows)) direction toward the top)

repeat with i from endOfRow to 2 by -1

if value of (cell 3 of row i) = “02” then

copy range entire row of (cell 1 of row i)

insert into range row (endOfRow + 4) of sheet “Sheet1”

delete range entire row of (cell 1 of row i)

end if

end repeat

end tell

end tell

and here is what I have been working on to do both:

tell application “Microsoft Excel”

set redcount to 0

set bluecount to 0

set numCells to first row index of (get end (cell 1 of row (count rows)) direction toward the top)

repeat with i from 1 to numCells

if the value of (cell 3 of row i) = “04” then

set red to entire row of (cell 3 of row i)

copy range entire row of (cell 3 of row i)

insert into range row (numCells + 4) of sheet “Sheet1”

set redcount to redcount + 1

end if

end repeat

set numCells to first row index of (get end (cell 1 of row (count rows)) direction toward the top)

repeat with i from 1 to numCells

if the value of (cell 3 of row i) = “06” then

copy range entire row of (cell 3 of row i)

insert into range row (numCells + 2) of sheet “Sheet1”

set bluecount to bluecount + 1

end if

end repeat

set numCells to first row index of (get end (cell 1 of row (count rows)) direction toward the top)

```
set firstRowRed to first row index of red
```

end tell

return redcount & bluecount

any Help would be great!!! :o

Thanks,