Hi All,
Just learnt about VBA yesterday and by watching Youtube Tutorials managed to copy and amend the code below to do what I want.
Sub Duplicatesheet()
'October for Hwee
Dim Counter As Integer
For Counter = 1 To Sheets(1).Range("AA3").Value
Sheets(2).Copy after:=Sheets(2)
ActiveSheet.Name = Sheets(1).Range("AA6").Offset(Counter - 1, 0) 'Copy sheet name from Sheet 1 Month
ActiveSheet.Range("B4").Value = Sheets(1).Range("R39") 'Copy staff name from Sheet 1
ActiveSheet.Range("F4").Value = Sheets(1).Range("R40") 'Copy staff Veh from Sheet 1
ActiveSheet.Range("J4").Value = Sheets(1).Range("AA6").Offset(Counter - 1, 0) 'Copy Date from Sheet 1
Next Counter
End Sub
Basically it Copies Sheet 2 and takes data from Sheet one and generates 1 sheet per day of the month (E.g. 31 for October). I would like to create these 28-31 sheets in a new Workbook and preferably name that file with info from Sheet 1 Cell R42.
This is all very new and exciting to me and that code above may not be optimal but it works and it excites me what VBA and excel can do.
Thanks for the help!
Bookmarks