This is a quick one, but a great snippet of code to have. This will add a new worksheet to your workbook and rename it to whatever you set. It’s only two lines, and very easy to place anywhere you need it.

'This line of code creates the new sheet
Set NewSheet = Sheets.Add(After:=Sheets(Worksheets.Count), _ 
     Count:=1, Type:=xlWorksheet)

'This line of code will rename it
NewSheet.Name = "Purchase_Orders" 

It’s that simple. Just enter this line anywhere you need a new worksheet.

Advertisements