Macro help please

air23live

New Member
Joined
Dec 31, 2015
Messages
15
For some reason I cannot attach the file but I have a master with employees info on it as well as date and than a timesheet template that looks like below.

Basically I want to have


  • Master sheet w/ date and employees name and craft code generate into individual timesheets


Below is an example, I already have the finished product Timesheet I just need a formula or Macro to generate these from the master list.
PERFORMANCE MECHANICAL INC WEEKLY TIME SHEET
clip_image002.gif

<tbody>
</tbody>

EMPLOYEE NAME:Cole, Randy
EMPLOYEE TRADE CODE:SUPTWEEK ENDING DATE:5/15/2016
JOB NUMBER/NAME:COST CODE:CHANGE ORDER #:MONDAY:TUESDAYWEDNESDAY:THURSDAY:FRIDAY:SATURDAY:SUNDAY:WEEK TOTAL:
STOTDTSTOTDTSTOTDTSTOTDTSTOT

<tbody>
</tbody>
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
try this,

you will need to adjust the ranges to fit your data

Code:
Sub do_it()


Dim ms As Worksheet, ts As Worksheet
Set ms = Worksheets("Master")
Set ts = Worksheets("Template")

For r = 2 To ms.Range("A" & Rows.Count).End(xlUp).Row

'adjust ranges as needed
mName = ms.Cells(r, "A") 'get name from Master Sheet
mDate = ms.Cells(r, "B") 'get Date from Master Sheet
mTcode = ms.Cells(r, "C") 'get Trade Code from Master Sheet


'write to template' adjust ranges as needed.

ts.Range("B4") = mName 'write the name
ts.Range("I4") = mDate 'write the Date
ts.Range("B5") = mTcode 'write the Trade Code

ts.Activate 'activate the Template sheet
ActiveSheet.PrintOut
Next r

End Sub

hth,

Ross
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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