Hope someone can help?
Maybe a small macro is all I need. I have a table 9 columns x 14 rows, the cells are mapped to a xml schema, the problem I have is when data is entered into some of the cells programmatically, I need to sort the table so all nil values are placed under items with values, then resize the table to exclude the nil values (leaving the data intact)
After posting the xml I then need to resize the table again to include all 14 rows.
many thanks
Rob
Update:
I have the following macro sorting the table and resizing manually, however I need the resizing to stop when a value more than zero is reached in say a qty column.
Sub Sort_Table()
'
' Sort_Table Macro
'
'
Range("Table2").Select
ActiveWorkbook.Worksheets("XML_DATA").ListObjects("Table2").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("XML_DATA").ListObjects("Table2").Sort.SortFields. _
Add2 Key:=Range("Table2[ns1:Qty]"), SortOn:=xlSortOnValues, Order:= _
xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("XML_DATA").ListObjects("Table2").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("K27").Select
ActiveSheet.ListObjects("Table2").Resize Range("$C$12:$K$15")
Range("K27").Select
End Sub
Bookmarks