I am having a problem with usedrange
I want to count the number of cells in a column for the purposes of a loop
I am using
ActiveSheet.UsedRange.Select
cellcount = Selection.Rows.Count
The trouble is the usedrange seems to pick up cells where there is no data. There may have been in the past but there is none there anymore. This sends the loop out of sync because too many rows are being counted.
Is there a way of refreshing the sheet to remove this 'ghost' data?
Andrew299
I want to count the number of cells in a column for the purposes of a loop
I am using
ActiveSheet.UsedRange.Select
cellcount = Selection.Rows.Count
The trouble is the usedrange seems to pick up cells where there is no data. There may have been in the past but there is none there anymore. This sends the loop out of sync because too many rows are being counted.
Is there a way of refreshing the sheet to remove this 'ghost' data?
Andrew299