jeffroth94
New Member
- Joined
- Dec 29, 2015
- Messages
- 8
Currently I use a macro to create a workbook with everyday of the month as the title of every tab. I am able to copy the template, that I have created, for each spreadsheet but it can get annoying to have to go in and copy and formula paste every time. Here is my current formula:
‘Code Starts here
Sub Dtpopulate()
Dim S As Integer
Dim X As Integer
S = Sheets("Temp").Range("c5").Value
For X = 1 To S
newname = Sheets("Temp").Range("a6").Value
Worksheets("Template").Activate
Sheets("Template").Cells.Select
Selection.Copy
Sheets.Add.Name = newname
Sheets(newname).Cells.Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Temp").Range("d5").Value = Sheets("Temp").Range("b5") + X
Next X
End Sub
Can I add more to this formula to be able to copy and paste formula?
‘Code Starts here
Sub Dtpopulate()
Dim S As Integer
Dim X As Integer
S = Sheets("Temp").Range("c5").Value
For X = 1 To S
newname = Sheets("Temp").Range("a6").Value
Worksheets("Template").Activate
Sheets("Template").Cells.Select
Selection.Copy
Sheets.Add.Name = newname
Sheets(newname).Cells.Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Temp").Range("d5").Value = Sheets("Temp").Range("b5") + X
Next X
End Sub
Can I add more to this formula to be able to copy and paste formula?