georges3374
New Member
- Joined
- Apr 22, 2015
- Messages
- 5
My Workbook starts off with three sheets. On the first is my summary sheet (named Summary), the second is my master sheet (named Master 0) that has a button to create subsequent sheets, the third sheet is the first of the sheets that I need to show up on my summary sheet (named Day 1). I need the information from Day 1 and subsequent sheets (Day 2, Day 3, etc...) to automatically feed in to my summary sheet. How do I reference a worksheet that doesn't actually exist yet without getting the #REF error??
Could I possibly add additional code to my existing Macro??
Sub Nextday()
Dim NewName As String
With Sheets(Sheets.Count)
NewName = "Day " & Val(Mid$(.Name, InStr(.Name, " "))) + 1
.Copy after:=Sheets(Sheets.Count)
End With
Sheets(Sheets.Count).Name = NewName
Range("C1").Value = Range("C1").Value + 1
Range("D1").Value = Range("D1").Value + 1
Range("J38:J55").Select
Selection.ClearContents
Range("B38:G55").Select
Selection.ClearContents
Range("H11:T34").Select
Selection.ClearContents
Range("B11:F34").Select
Selection.ClearContents
End Sub
Thank you.
Could I possibly add additional code to my existing Macro??
Sub Nextday()
Dim NewName As String
With Sheets(Sheets.Count)
NewName = "Day " & Val(Mid$(.Name, InStr(.Name, " "))) + 1
.Copy after:=Sheets(Sheets.Count)
End With
Sheets(Sheets.Count).Name = NewName
Range("C1").Value = Range("C1").Value + 1
Range("D1").Value = Range("D1").Value + 1
Range("J38:J55").Select
Selection.ClearContents
Range("B38:G55").Select
Selection.ClearContents
Range("H11:T34").Select
Selection.ClearContents
Range("B11:F34").Select
Selection.ClearContents
End Sub
Thank you.