VB Code:
Sub X() Set rng = Range("I18:L95") aydata = rng rng.ClearContents desrow = 1 For i = LBound(aydata) To UBound(aydata) If aydata(i, 3) <> 0 Then For j = 1 To 3 rng.Cells(desrow, j) = aydata(i, j) Next j If desrow / 15 = Int(desrow / 15) Then desrow = desrow + 1 Else desrow = desrow + 1 End If Next i End Sub
This code deletes the values from the rows in a table with a blank in the third column and moves the values in the rows with a numeric value in the third column up to fill the spaces.
For example:
da-006 acrylic 20
db-008 acrylic
dc-012 acrylic 10
Becomes...
da-006 acrylic 20
dc-012 acrylic 10
Sometimes, in a seperate row, underneath the row with a blank or numeric value is a description.
Is there anyway to keep the description if the above row remains but if the above row is deleted, the description would be too??
For example:
da-006 acrylic 20
1. description...
db-008 acrylic
2. description....
dc-012 acrylic 10
Becomes...
da-006 acrylic 20
1. description...
dc-012 acrylic 10
The values of all the columns change depending on the job at hand, so does the description. The description is always longer than 10 characters, if that helps.
Any idea how to accomplish this??




Reply With Quote