Hello,
I presently have a 1 sheet report in excel which is automated. The automation process basically creates individualized reports for 5 different people.
I would like to add a second sheet to this process, but I'm not sure how. Can you please help???
Below is a sample of the process:
Public Sub OutputToFile(wks_array() As Single, rpt_lang As String)
Dim filename As String
Dim temp_num_sheets As Integer
Dim temp_indx As Integer
Select Case rpt_lang
Case "E"
filename = "john smith report" & " .xls"
End Select
Sheets(wks_array).Select
ActiveWindow.SelectedSheets.Copy
temp_num_sheets = Worksheets.Count
For temp_indx = 1 To temp_num_sheets
Sheets(temp_indx).Activate
ActiveSheet.Range("A1:CA2000").Copy
ActiveSheet.Range("A1:CA2000").PasteSpecial Paste:=xlPasteValues
ActiveSheet.Protect Password:="pass", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.Range("C1").Select
Next temp_indx
ActiveWorkbook.Colors(38) = RGB(59, 90, 111)
ActiveWorkbook.Colors(39) = RGB(234, 234, 234)
Sheets(1).Activate
'ActiveSheet.Protect Password:="asdf", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.SaveAs "C:\" & filename
Workbooks(filename).Close SaveChanges:=False
End Sub <!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->
I presently have a 1 sheet report in excel which is automated. The automation process basically creates individualized reports for 5 different people.
I would like to add a second sheet to this process, but I'm not sure how. Can you please help???
Below is a sample of the process:
Public Sub OutputToFile(wks_array() As Single, rpt_lang As String)
Dim filename As String
Dim temp_num_sheets As Integer
Dim temp_indx As Integer
Select Case rpt_lang
Case "E"
filename = "john smith report" & " .xls"
End Select
Sheets(wks_array).Select
ActiveWindow.SelectedSheets.Copy
temp_num_sheets = Worksheets.Count
For temp_indx = 1 To temp_num_sheets
Sheets(temp_indx).Activate
ActiveSheet.Range("A1:CA2000").Copy
ActiveSheet.Range("A1:CA2000").PasteSpecial Paste:=xlPasteValues
ActiveSheet.Protect Password:="pass", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.Range("C1").Select
Next temp_indx
ActiveWorkbook.Colors(38) = RGB(59, 90, 111)
ActiveWorkbook.Colors(39) = RGB(234, 234, 234)
Sheets(1).Activate
'ActiveSheet.Protect Password:="asdf", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.SaveAs "C:\" & filename
Workbooks(filename).Close SaveChanges:=False
End Sub <!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->