I keep getting a Runtime Error 1004 with a particular macro. The debug option always take me back to the "UsedRange" portion of:
If ws2.Range("A:A" & Rows.Count).End(xlUp).Row > 4 Then ws2.UsedRange.Offset(4).Clear
What's so frustrating is that if I copy and paste the contents to a brand new worksheet, and copy and paste the macro as a new sub, then it works flawlessly. No change in code or worksheet data, just a refreshing of everything else. With no particular relativity, it seems to eventually cause the same Runtime Error 1004, to which the same corrective action will temporarily resolve it.
Does anyone know what could be causing this instability in what seems to be a functional code?
If ws2.Range("A:A" & Rows.Count).End(xlUp).Row > 4 Then ws2.UsedRange.Offset(4).Clear
What's so frustrating is that if I copy and paste the contents to a brand new worksheet, and copy and paste the macro as a new sub, then it works flawlessly. No change in code or worksheet data, just a refreshing of everything else. With no particular relativity, it seems to eventually cause the same Runtime Error 1004, to which the same corrective action will temporarily resolve it.
Does anyone know what could be causing this instability in what seems to be a functional code?