copying values based on Date and moving to empty columns pls help !

annamvs2009

New Member
Joined
Mar 15, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi All

I haven't used VBA for 6 years and I completely forgot some basics.

I've got two sheets , one is called Master and another is called Data. I would like my employee to go into the Master Data and put a Date in Cell B2 and input the daily production units and m3 and number of people who were cutting wood (it's a pellet production company).

Basically I'd like this guy to do this on a daily basis so the macro would need to copy and paste data from today's date into the "Data "sheet then once he goes in tomorrow he will overwrite the Master data but then I need my macro to copy this over to "Data" again. The end result will be a huge spreadsheet with 300 or so working days with values in them. I will create a summary table from it but unfortunately I need this to be tracker on a daily basis for now until the Company starts to make profits .


Is this possible as I have just spent 2 hrs of my life on this :D ! Thank you . Much appreciated!

PS I added two buttons for this guy to make it easier, Clear Data could clear Master file from "Date", and values in all columns" and "End" Button could have a macro assigned which is copying the data to "Data" Sheet
smile.gif


Anna
 

Attachments

  • excel.JPG
    excel.JPG
    82.1 KB · Views: 11

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi & welcome to MrExcel.
You haven't said where to put the data on the data sheet, so this will put it in cols A:D below any existing data.
VBA Code:
Sub annamvs()
   Dim Rng As Range
   
   With Sheets("Master")
      Set Rng = Intersect(.Range("D4:H" & .Range("D" & Rows.Count).End(xlUp).Row), .Range("D:D,F:F,H:H"))
   End With
   With Sheets("Data")
      With .Range("A" & Rows.Count).End(xlUp)
         .Offset(1).Resize(Rng.Rows.Count).Value = Sheets("Master").Range("B2").Value
         Rng.Copy .Offset(1, 1)
      End With
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,877
Messages
6,122,051
Members
449,064
Latest member
scottdog129

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
Back
Top