Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to create a new xls file made of the content of ny current Sheet2 (not sheet1 or 3). is it possible? Many thanks, Dan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worksheets("Sheet2").Copy
-- __________________________________ HTH Bob "Dan" wrote in message ... Hi, I would like to create a new xls file made of the content of ny current Sheet2 (not sheet1 or 3). is it possible? Many thanks, Dan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Dan
Try this: Sub CopySheet2ToNewWb() Dim wbA As Workbook Dim wbNew As Workbook With Application SheetsInWb = .SheetsInNewWorkbook .SheetsInNewWorkbook = 1 .DisplayAlerts = False .ScreenUpdating = False End With Set wbA = ThisWorkbook Set wbNew = Workbooks.Add wbA.Sheets("Sheet2").Copy wbNew.Sheets(1) wbNew.Sheets("Sheet1").Delete With Application .SheetsInNewWorkbook = SheetsInWb .DisplayAlerts = True .ScreenUpdating = True End With End Sub Regards, Per "Dan" skrev i meddelelsen ... Hi, I would like to create a new xls file made of the content of ny current Sheet2 (not sheet1 or 3). is it possible? Many thanks, Dan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Per
"Per Jessen" wrote: Hi Dan Try this: Sub CopySheet2ToNewWb() Dim wbA As Workbook Dim wbNew As Workbook With Application SheetsInWb = .SheetsInNewWorkbook .SheetsInNewWorkbook = 1 .DisplayAlerts = False .ScreenUpdating = False End With Set wbA = ThisWorkbook Set wbNew = Workbooks.Add wbA.Sheets("Sheet2").Copy wbNew.Sheets(1) wbNew.Sheets("Sheet1").Delete With Application .SheetsInNewWorkbook = SheetsInWb .DisplayAlerts = True .ScreenUpdating = True End With End Sub Regards, Per "Dan" skrev i meddelelsen ... Hi, I would like to create a new xls file made of the content of ny current Sheet2 (not sheet1 or 3). is it possible? Many thanks, Dan |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Per
Bob's way is easier to make a workbook of one sheet but if you do it your way then there is no need to set the SheetsInNewWorkbook This will add a workbook with one sheet Set wbNew = Workbooks.Add(1) Or use Workbooks.Add(xlWBATWorksheet). -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Per Jessen" wrote in message ... Hi Dan Try this: Sub CopySheet2ToNewWb() Dim wbA As Workbook Dim wbNew As Workbook With Application SheetsInWb = .SheetsInNewWorkbook .SheetsInNewWorkbook = 1 .DisplayAlerts = False .ScreenUpdating = False End With Set wbA = ThisWorkbook Set wbNew = Workbooks.Add wbA.Sheets("Sheet2").Copy wbNew.Sheets(1) wbNew.Sheets("Sheet1").Delete With Application .SheetsInNewWorkbook = SheetsInWb .DisplayAlerts = True .ScreenUpdating = True End With End Sub Regards, Per "Dan" skrev i meddelelsen ... Hi, I would like to create a new xls file made of the content of ny current Sheet2 (not sheet1 or 3). is it possible? Many thanks, Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a list from another sheet or workbook | Excel Discussion (Misc queries) | |||
Creating a new sheet from specific data in existing sheet | Excel Discussion (Misc queries) | |||
Creating form on sheet 1 and having info move to sheet 2 | Excel Discussion (Misc queries) | |||
Creating new sheet named one week newer that active sheet | Excel Programming | |||
Q: Creating a macro to sort and group columns in a sheet according to another sheet | Excel Programming |