Hello All,
I'm trying to do a simple module to save the results of a calculator (in excel of course) in a list.
The code I am using is
It correctly places the values where I want them, but any subsequent values are instead replacing the original saved values. I suspect the error is in the
part, but I'm not sure.
Thanks!
I'm trying to do a simple module to save the results of a calculator (in excel of course) in a list.
The code I am using is
Code:
Sub SaveResult()
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Calculator")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 8).Value = "Converted"
.Cells(lRow, 9).Value = Range("C5").Value
.Cells(lRow, 10).Value = Range("C10").Value
.Cells(lRow, 11).Value = "to"
.Cells(lRow, 12).Value = Range("C15").Value
.Cells(lRow, 13).Value = Range("E10").Value
End With
End Sub
It correctly places the values where I want them, but any subsequent values are instead replacing the original saved values. I suspect the error is in the
Code:
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Thanks!
Last edited: