Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steve,
One way: Dim WS As Worksheet Set WS = ActiveSheet ThisWorkbook.Worksheets.Add WS.Activate NickHK "Steve Haack" wrote in message ... I am unsing the .Copy method to add new worksheets to a workbook, by copying a template sheet that is already in the workbook. I am calling the code from a command button placed on a home "sheet". The code works fine, but when it adds the new sheet, it changes the focus to it. I would like to know if it is possible to copy/add the new sheet and not have it gain the focus? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Slight modification:
Dim WS As Worksheet Set WS = ActiveSheet Application.ScreenUpdating = False ThisWorkbook.Worksheets.Add WS.Activate Application.ScreenUpdating = True - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "NickHK" wrote in message ... Steve, One way: Dim WS As Worksheet Set WS = ActiveSheet ThisWorkbook.Worksheets.Add WS.Activate NickHK "Steve Haack" wrote in message ... I am unsing the .Copy method to add new worksheets to a workbook, by copying a template sheet that is already in the workbook. I am calling the code from a command button placed on a home "sheet". The code works fine, but when it adds the new sheet, it changes the focus to it. I would like to know if it is possible to copy/add the new sheet and not have it gain the focus? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And one more modification...
'-- Dim WS As Worksheet Set WS = ActiveSheet Application.ScreenUpdating = False ThisWorkbook.Worksheets.Add Count:=1 WS.Activate Application.ScreenUpdating = True -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Jon Peltier" wrote in message Slight modification: Dim WS As Worksheet Set WS = ActiveSheet Application.ScreenUpdating = False ThisWorkbook.Worksheets.Add WS.Activate Application.ScreenUpdating = True - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "NickHK" wrote in message Steve, One way: Dim WS As Worksheet Set WS = ActiveSheet ThisWorkbook.Worksheets.Add WS.Activate NickHK "Steve Haack" wrote in message I am unsing the .Copy method to add new worksheets to a workbook, by copying a template sheet that is already in the workbook. I am calling the code from a command button placed on a home "sheet". The code works fine, but when it adds the new sheet, it changes the focus to it. I would like to know if it is possible to copy/add the new sheet and not have it gain the focus? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Short cut for switching between worksheets | Excel Worksheet Functions | |||
Switching between Worksheets | Excel Programming | |||
Switching between Worksheets | Excel Programming | |||
Switching between worksheets | Excel Programming | |||
Switching to different worksheets during a macro | Excel Programming |