ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   inserting worksheet and name (https://www.excelbanter.com/excel-programming/277852-inserting-worksheet-name.html)

Bill Starr

inserting worksheet and name
 
I saw some code somewhere, but I can't find it anymore.

I need to insert a worksheet and then name this new
sheet 'vacation'. The workbook may already have a sheet
called 'sheet1' or 'sheet2'.

thanks.
Bill

Dave Peterson[_3_]

inserting worksheet and name
 
worksheets.add
on error resume next
activesheet.name = "vacation"
if err.number < 0 then
msgbox "couldn't rename"
err.clear
end if
on error goto 0



Bill Starr wrote:

I saw some code somewhere, but I can't find it anymore.

I need to insert a worksheet and then name this new
sheet 'vacation'. The workbook may already have a sheet
called 'sheet1' or 'sheet2'.

thanks.
Bill


--

Dave Peterson



All times are GMT +1. The time now is 07:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com