adding cell data to a record

M

MikeH

Hi all, I have a sheet set up for some quick input on a few cells and
calculations are made in several other cells to estimate customers jobs. I
would like to set up a way to add data that was calculated on that sheet,
named "estimate" (cells L5:L11, L17:L19, L21:L26) to a new record in a sheet
called "data" in the same workbook. But only if I select to do so (the
estimate accepted or declined by the customer) Thanks, Mike
 
S

Sheeloo

You can assign this macro to a button and run when you want...
Sub CopyRow()

'----------------
Dim i, j As Integer
Dim LastRow As Long

With Worksheets("Data")
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1

End With
MsgBox LastRow

j = 1
For i = 5 To 11
Sheets("Data").Cells(LastRow, j).Value = Sheets("Estimate").Cells(i, 12).Value

j = j + 1
Next

For i = 17 To 19
Sheets("Data").Cells(LastRow, j).Value = Sheets("Estimate").Cells(i, 12).Value
j = j + 1
Next

For i = 21 To 26
Sheets("Data").Cells(LastRow, j).Value = Sheets("Estimate").Cells(i, 12).Value
j = j + 1
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top