Need to Reference a Worksheet that Doesn't Exsist Yet Without #REF

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.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top