Tough Time Transferring information as Date Changes

startzer

Board Regular
Joined
Jan 21, 2010
Messages
105
what i have is a daily log of information on certain units.... Each unit has a line with approx ten data points... ie A1 = tubing pressure , A2 = casing pressure , A3 = well head volume.... and unit #2 would be on line 2 etc.

What i am trying to do is transfer unit #1 data points from daily log workbook to a seperate work book that keeps each day worth of data for 31 days. ie line #1 would be for march 1st, line 2 for march 2nd.

How can i set up my daily log workbook to transfer this data on a save command?

So on march 1st i would fill out data points for 4 units. when saving i would like the information to be transfered on line #1 of 4 seperate work books (unit1, unit2....) and on march 2nd the information would be transfered to line #2 of corresponding workbooks.?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

venkat1926

Well-known Member
Joined
Aug 21, 2005
Messages
4,824
It is easier to write a code if you want to copy each unit data for each day in separate sheets in the same workbooks. the inserted sheets will be called unit1, unit2 etc except that the main sheet is called sheet1

in that case in an experimenta data workbooks try this macro and use it for your original file


the sheet 1 data (sample) will be like this.

unit no. tubing pr casing pr well head pr date
1 84 81 66 1-Mar
2 21 48 88
3 15 40 46
4 1 31 70
5 27 13 3

the macro will be

Code:
Sub test()
Dim r As Range, c As Range, dte As Long
Worksheets("sheet1").Activate
Set r = Range(Range("A2"), Range("A2").End(xlDown))
dte = Range("E2")
For Each c In r
Range(c.Offset(0, 1), c.Offset(0, 3)).Copy
With Worksheets("unit" & c.Value)
.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial
.Cells(Rows.Count, "D").End(xlUp).Offset(1, 0) = dte
.Cells(Rows.Count, "d").End(xlUp).NumberFormat = "dd-mmm-yy"
End With
Next c
End Sub

modify macro if necessary
 

Forum statistics

Threads
1,141,282
Messages
5,705,483
Members
421,398
Latest member
Rahat Anwar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top