Hi, i have a code where i have tried to adjust it to do the following:
1. At the bottom of column B (in this case row 84) to copy this row and insert it above.
2. I have a if Formula =IF(B81="Mar","Jun",IF(B81="Jun","Sep",IF(B81="Sep","Dec",IF(B81="Dec","Mar")))) - but this keeps referring to B81 rather than the one above it. I would like this VBA code to paste the value.
3. Subsequently then delete the row of data from C:R
The code i have is this which isnt working:
The problem is:
1.Formula doesnt paste value
2.The data it deletes is from row 94
Ideally i would like to change the months in the row 87, 91, 93 and 94
e.g, row 91: When updated it should be December
1. At the bottom of column B (in this case row 84) to copy this row and insert it above.
2. I have a if Formula =IF(B81="Mar","Jun",IF(B81="Jun","Sep",IF(B81="Sep","Dec",IF(B81="Dec","Mar")))) - but this keeps referring to B81 rather than the one above it. I would like this VBA code to paste the value.
3. Subsequently then delete the row of data from C:R
The code i have is this which isnt working:
VBA Code:
Sub AddRowMonthTab6()
Range("C2").Select
With Range("C" & Rows.Count).End(xlUp)
.Offset(-10, -2).Resize(, 22).Copy
.Offset(-10, -2).Insert xlDown
Application.CutCopyMode = False
.Offset(-10, 0).Select
' Intersect(.EntireRow, Range("C:U")).ClearContents
End With
With Range("C" & Rows.Count).End(xlUp)
.Offset(-10, -1).FormulaR1C1 = "=IF(R[-1]C=""Mar"",""Jun"",IF(R[-1]C=""Jun"",""Sep"",IF(R[-1]C=""Sep"",""Dec"",IF(R[-1]C=""Dec"",""Mar""))))"
.Value = .Value
'Intersect(.EntireRow, Range("D:U")).Clear
End With
With Range("C" & Rows.Count).End(xlUp)
Intersect(.EntireRow, Range("D:U")).Clear
'End With
End Sub
The problem is:
1.Formula doesnt paste value
2.The data it deletes is from row 94
Ideally i would like to change the months in the row 87, 91, 93 and 94
e.g, row 91: When updated it should be December