I'm copying the "History" worksheet, the one reserved for "Track Changes", to a backup worksheet called "History Repository". I use the following simple VBA code:
If wb.Worksheets("History").UsedRange.Count > 1 Then _
wb.Worksheets("History").UsedRange.Copy wb.Worksheets("History Repository").Cells(LastRepositoryRow + 1, 1)
I'm getting the following WRONG results:
1 - The "Range" column, the one that shows the cell (or range) that was changed, always reports 3 rows less in "History Repository". For example, if "History" has "A26" then "History Repository" has "A23". This is consistent throughout.
2 - The "Range" column for various rows shows #REF! for all columns in that row. For example if "History" shows "A31, B31, C31, ...", "History Repository" shows "#REF!, #REF!, #REF! ...". I'm not sure whether there is a pattern here for which rows are impacted. I observed it for the following rows based on the "History" sheet's row numbers in the "Range" column:
31, 37, 43, 45, 46, 47
Has anybody experienced this or have any ideas why this might occur? My code does NOT have any logic that alters what's being copied?
If wb.Worksheets("History").UsedRange.Count > 1 Then _
wb.Worksheets("History").UsedRange.Copy wb.Worksheets("History Repository").Cells(LastRepositoryRow + 1, 1)
I'm getting the following WRONG results:
1 - The "Range" column, the one that shows the cell (or range) that was changed, always reports 3 rows less in "History Repository". For example, if "History" has "A26" then "History Repository" has "A23". This is consistent throughout.
2 - The "Range" column for various rows shows #REF! for all columns in that row. For example if "History" shows "A31, B31, C31, ...", "History Repository" shows "#REF!, #REF!, #REF! ...". I'm not sure whether there is a pattern here for which rows are impacted. I observed it for the following rows based on the "History" sheet's row numbers in the "Range" column:
31, 37, 43, 45, 46, 47
Has anybody experienced this or have any ideas why this might occur? My code does NOT have any logic that alters what's being copied?