Yup, I noticed as I ran the formula but just amended the values to 8 and your
solution works very well.
All that I need now is to shift the results up to the top of the sheet. As
this will vary with each import I am unsure how to ask Excel to choose just
the results cut and paste them to the top. Maybe, its F5 select visibles copy
and paste? Apologies for the badly worded "without collapsing the above
columns" bit.
So far the code is (Sorry if I am not using the proper convention to show
this)
Sub Cleanupdata()
'
' Cleanupdata Macro
' Macro recorded 21/05/2009 by Keith
'
'
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Range("A2").Select
ActiveCell.FormulaR1C1 = "=IF(COUNTA(RC[1]:RC[49])<>8,""not 8"",8)"
Selection.AutoFill Destination:=Range("A2:A42"), Type:=xlFillDefault
Range("A2:A42").Select
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="not 8"
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.ClearContents
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
End Sub
Gord Dibben said:
Actually we both made a mistake.............A:H is 8 columns, not 7 so
formula will have to adjusted if you want 8
Your subject line reads 7 columns but you state " columns A to
H"...........I missed that first time around.
Not sure what you mean by "without collapsing the above columns".
Deleting the helper column you inserted should give you 7 columns A:G
Gord