ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   adding cell data to a record (https://www.excelbanter.com/excel-discussion-misc-queries/208396-adding-cell-data-record.html)

MikeH

adding cell data to a record
 
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

Sheeloo[_3_]

adding cell data to a record
 
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

"MikeH" wrote:

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


MikeH

adding cell data to a record
 
Thank you very much sheeloo, its very very appreciated, Mike

"Sheeloo" wrote:

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

"MikeH" wrote:

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



All times are GMT +1. The time now is 02:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com