Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding a new sheet (no focus)
Hi all,
I have a workbook with a sheet called "Master" and I am using th following line of code to add a new sheet called "Test" (if "Test" doe not already exist) : Sheets.Add.Name = "Test" Is it possible to add this new sheet WITHOUT Excel automatically makin that the active sheet. TIA Seamu -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding a new sheet (no focus)
Hi Seamus
Don't think so. Here's a workaround: Sub test() Dim S As Worksheet, T As Worksheet Set S = ActiveSheet On Error Resume Next Application.ScreenUpdating = False Set T = Sheets.Add T.Name = "Test" T.Move after:=Worksheets(ActiveWorkbook.Worksheets.Count) S.Activate Application.ScreenUpdating = True End Sub HTH. best wishes Harald "SOS " skrev i melding ... Hi all, I have a workbook with a sheet called "Master" and I am using the following line of code to add a new sheet called "Test" (if "Test" does not already exist) : Sheets.Add.Name = "Test" Is it possible to add this new sheet WITHOUT Excel automatically making that the active sheet. TIA Seamus --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding a new sheet (no focus)
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ADDING/DELETING SHEET Without losing focus? | Excel Discussion (Misc queries) | |||
HELP!! Unhide Sheet with Macro and focus on other sheet | Excel Discussion (Misc queries) | |||
Printing switches focus off proper sheet | Excel Worksheet Functions | |||
Focus back from modeless userform to sheet | Excel Programming | |||
Must be a way to force focus back to sheet instead of UserForm - isn't there? | Excel Programming |