I am trying to run a macro that: Adds 1 to the cell above IN another sheet in the workbook and places it in the cell below. However the cell that it adds to is dynamic, the macro adds a new line for a new entry. Below is the code I have so far. cellRef
should do the adding, but I am getting random figures and errors! (mismatch once and random figures other times)
Sub update_Number()
cellRef = ActiveWorkbook.Sheets("RMA").Range("A" & (ActiveCell.Row)).Offset(-1, 0).Value
ActiveWorkbook.ActiveSheet.Select
customeRef = Range("c" & (ActiveCell.Row))
customerName = Range("d" & (ActiveCell.Row))
customerCountry = Range("e" & (ActiveCell.Row))
customerCompany = Range("f" & (ActiveCell.Row))
datePaid = Range("g" & (ActiveCell.Row))
Dim wks As Worksheet
Set wks = Sheets("RMA")
With wks
Dim RowCount As Long
RowCount = .Range("A8").End(xlDown).Row + 1
.Cells(RowCount, 1) = cellRef + 1
.Cells(RowCount, 2) = customeRef
.Cells(RowCount, 3) = customerName
.Cells(RowCount, 4) = customerCountry
.Cells(RowCount, 5) = customerCompany
.Cells(RowCount, 6) = datePaid
End With
End Sub