PeterBaileyUk
asked on
clear spreadsheet to last row
I want to clear the spreadsheet but the code I have at present does not clear down properly leaving rows from before.
Set wks = Sheets("CWCodesToMatch")
wks.Range("a1").CurrentRegion.ClearContents
For iCols = 0 To qdf.OpenRecordset.Fields.Count - 1
wks.Cells(1, iCols + 1).Value = qdf.OpenRecordset.Fields(iCols).Name
Next
wks.Range("A2").CopyFromRecordset qdf.OpenRecordset
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.