How do you create a macros without overwriting the previous one y.

G

Gibbie

The worksheet that I have has several tabs along the bottom;
Report/Report2/Report3 etc…/Deliveries/Credits/Weekly Inventory/Recap What I
am trying to do is create a macro that makes a new Report tab daily, I have
done the Macro that creates the daily new report tab but the macro I have
created always copies the original tab. I would like to find out a way that
this macro will always create a copy of the latest report tab.
 
D

Don Guillett

maybe have it find the name of the last sheet

Sub lastsheetname()
ls = Sheets(Worksheets.Count).Name
MsgBox ls
End Sub
 
J

JE McGimpsey

One way:

Public Sub try98790890()
Dim i As Long
With Worksheets
For i = 1 To .Count
If Not LCase(.Item(i).Name) Like "report*" Then Exit For
Next i
.Item(i - 1).Copy after:=.Item(i - 1)
End With
End Sub
 
Top