06-18-2019 10:56 AM
Hello,
I am trying to create a workbook in which new worksheet names are automatically showing the current date and month.
For example, i have a worksheet named May 2019. I would like to insert a new worksheet that is automatically renamed to Jun 2019. When i create one in July, it would automatically be renamed to Jul 2019 and so on...
Is there a way to do this, please?
Thank you.
06-19-2019 01:22 AM
06-27-2019 05:40 AM
@Jan Karel Pieterse I am not looking for any reporting afterwards. We are looking at each sheet in the month it occurs. There will be too much data on one sheet to put all the months on one sheet. But thank you for your suggestion.
06-27-2019 07:35 AM
Solution@AnaPistol This macro checks if there alreay is a worksheet for the current month. If not it creates one. If there is, it selects it:
Sub AddMonthSheet() Dim sName As String Dim oSh As Worksheet sName = Format(Date, "yyyy-mmm") On Error Resume Next Set oSh = Worksheets(sName) If oSh Is Nothing Then Set oSh = Worksheets.Add End If oSh.Name = sName oSh.Activate End Sub
07-05-2019 09:22 AM
@Jan Karel Pieterse Thank you! This worked exactly how i needed it to!
07-05-2019 11:07 AM
07-05-2019 11:23 AM
@Twifoo This is a very large site with a number of different communities, so our team does not have time to police best responses, which is voluntary on the part of users (please don't tag me on these).
If you have an overall suggestion for the site, feel free to submit it in our Community Ideas space.
07-05-2019 11:33 AM
07-05-2019 11:37 AM
@Twifoo I mentioned it in case you have an overall suggestion for how we handle Best Responses. I don't know what your overall suggestion is, so I can't really do it for you. I'm also a community manager and that idea board is specifically for ideas from the community itself, not from the staff.
Thanks!
07-05-2019 11:41 AM
07-05-2019 12:55 PM
@Twifoo , @Eric Starker - here I moved the best response on Jan Karel
07-05-2019 01:18 PM