hello
im trying to make a macro so that if the "raw data" tab has more rows than the "calculations" tab, more rows will be added according to the difference.
if the opposite is true, then delete the rows above....here's what I have so far, but the resize propert doesn't work with negative values it seems.
im trying to make a macro so that if the "raw data" tab has more rows than the "calculations" tab, more rows will be added according to the difference.
if the opposite is true, then delete the rows above....here's what I have so far, but the resize propert doesn't work with negative values it seems.
Code:
Sheets("Raw Data").Select
finalrow_r = Cells(Rows.Count, "A").End(xlUp).Row
Sheets("Calculations").Select
finalrow_c = Cells(Rows.Count, "A").End(xlUp).Row
difference = finalrow_r - finalrow_c
If difference > 0 Then
Sheets("calculations").Select
Range("a" & finalrow_c).Offset(1).EntireRow.Resize(difference).Insert Shift:=xlDown
'ElseIf difference < 0 Then
'Range("a" & finalrow_c).EntireRow.Resize(difference).Delete Shift:=xlUp
End If