My doubt is this.
I need to write a program to open an excel sheet and copy 3 excel sheet into single .xls file which should contain 3 excel sheets.How do i proceed?
My doubt is this.
I need to write a program to open an excel sheet and copy 3 excel sheet into single .xls file which should contain 3 excel sheets.How do i proceed?
To create your new workbook with three sheets you can use
Sub Test()
Workbooks.Add
If ActiveWorkbook.Sheets.Count < 3 Then
For N = 1 To 3 - ActiveWorkbook.Sheets.Count
Sheets.Add
Next N
ElseIf ActiveWorkbook.Sheets.Count > 3 Then
Application.DisplayAlerts = False
For N = 1 To ActiveWorkbook.Sheets.Count - 3
Sheets(1).Delete
Next N
Application.DisplayAlerts = True
End If
End Sub
Martin
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks