Hi I have this VBA which copies and pastes data from one sheet into the next empty row on another worksheet.
The problem is, Cell E4 has a specific formula that works out the week value and it keeps being cleared when the macro is run.
Effectively I need cell A4 copied but not cleared.
Or I need to add code to put the (=AH8) basic formula back into the Cell "E4" on the "Record Data" Worksheet.
I would welcome some help
thank you
Sub PasteToNextEmptyRow()
Dim targetCell As Range
Set targetCell = Range("E4")
targetCell.Value = "=(P4)"
Range("a4:E4").Copy
Sheets("Income").Range("a" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Range("A4:E4").Select
Selection.ClearContents
Sheets("RECORD DATA").AutoFilter.ApplyFilter
Range("A6:A3000").Select
Selection.NumberFormat = "dd/mm/yyyy;@"
Range("C6:C3000").Select
Selection.NumberFormat = "$#,##0.00"
Range("B33").Select
ActiveSheet.Range("A4").Select
End Sub
The problem is, Cell E4 has a specific formula that works out the week value and it keeps being cleared when the macro is run.
Effectively I need cell A4 copied but not cleared.
Or I need to add code to put the (=AH8) basic formula back into the Cell "E4" on the "Record Data" Worksheet.
I would welcome some help
thank you
Sub PasteToNextEmptyRow()
Dim targetCell As Range
Set targetCell = Range("E4")
targetCell.Value = "=(P4)"
Range("a4:E4").Copy
Sheets("Income").Range("a" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Range("A4:E4").Select
Selection.ClearContents
Sheets("RECORD DATA").AutoFilter.ApplyFilter
Range("A6:A3000").Select
Selection.NumberFormat = "dd/mm/yyyy;@"
Range("C6:C3000").Select
Selection.NumberFormat = "$#,##0.00"
Range("B33").Select
ActiveSheet.Range("A4").Select
End Sub