ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding new sheets to the right instead of the default left (https://www.excelbanter.com/excel-programming/404063-adding-new-sheets-right-instead-default-left.html)

Max

Adding new sheets to the right instead of the default left
 
How could the line below so that new sheets are added to the right (instead
of the default left):

Set WSNew = Sheets.Add

Thanks



Max

Adding new sheets to the right instead of the default left
 
Oops, it should read as:

How could the line below be amended so that new sheets are added to the
right (instead
of the default left):
Set WSNew = Sheets.Add



Gary Keramidas

Adding new sheets to the right instead of the default left
 

don't use both of these, just 2 examples


Sub test()
Dim wsnew As Worksheet
Set wsnew = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
Set wsnew = Worksheets.Add(after:=Worksheets("Sheet2"))
End Sub
--


Gary


"Max" wrote in message
...
How could the line below so that new sheets are added to the right (instead of
the default left):

Set WSNew = Sheets.Add

Thanks




Max

Adding new sheets to the right instead of the default left
 
Gary, thanks for the examples. Very helpful.




All times are GMT +1. The time now is 09:06 AM.

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