hi
I would add some lines to this code when I add a new sheet if from the first time then should add and if I repeat again add a new sheet then should prevent add a new sheet until change the value in D3 it shouldn't add a new sheet contains for the same value in d3 for more than sheet .
any help will truly appreciate
I would add some lines to this code when I add a new sheet if from the first time then should add and if I repeat again add a new sheet then should prevent add a new sheet until change the value in D3 it shouldn't add a new sheet contains for the same value in d3 for more than sheet .
VBA Code:
Sub CreateNewSheet()
Dim dDate As Long
Dim oNum As String
Dim lst As Long
sheet1.Copy After:=Sheets(Sheets.Count)
With ActiveSheet
dDate = .Range("B3").Value
oNum = .Range("D3").Value
lst = .Range("A" & Rows.Count).End(xlUp).Row
.Columns(3).Insert
.Columns("1").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
.Range("A4").Value = "date"
.Range("D4").Value = "order"
.Range("A5:A" & lst).Value = Format(dDate, "dd/mm/yyyy")
.Range("D5:D" & lst).Value = oNum
.Rows("1:3").Clear
End With
End Sub