hi all,
So my question is, I have and two tabs ("Materials" and "Delivery") I would like to import into and existing workbook we use for quotations. the tab "Materials" work perfectly under the code below:
Private Sub CommandButton1_Click()
'Read Data
Dim wsname As String
Dim hours As Integer
hours = Range("h65")
wsname = ActiveWorkbook.Name
'Worksheets("Materials").Visible = False
'Open Workbook
Workbooks.Open "\\TWS-VS1061\Template\IBMS\HQ FORMS\300 - Commercial\HQ 304 Estimate Summary (2018 Rates).XLSM"
'Change Dir.
ChDir "\\TWS-VS1061\Template\IBMS\HQ FORMS\300 - Commercial"
'Write Data
'Workbooks("Quotation Mk1.xlsm").Sheets("Materials").Copy Before:=Workbooks("HQ 304 Estimate Summary (2018 Rates).XLSM").Sheets(6)
Workbooks(wsname).Sheets("Materials").Copy Before:=Workbooks("HQ 304 Estimate Summary (2018 Rates).XLSM").Sheets(6)
Worksheets("BudgetSummary").Activate
Worksheets("BudgetSummary").Range("C12").Value = 11
Worksheets("BudgetSummary").Range("N25").Value = "=Materials!H65+AF32"
Worksheets("BudgetSummary").Range("E41").Value = "=Materials!I65"
'Worksheets("Materials").Visible = True
Worksheets("materials").PageSetup.PrintArea = "$A$1:$j$68"
End Sub
How could I do to export the tab "Delivery" at the same time along the tab "Materials", I am frying my brain for a few days but I cant find out a solution, any help please?? thank you in advance...
So my question is, I have and two tabs ("Materials" and "Delivery") I would like to import into and existing workbook we use for quotations. the tab "Materials" work perfectly under the code below:
Private Sub CommandButton1_Click()
'Read Data
Dim wsname As String
Dim hours As Integer
hours = Range("h65")
wsname = ActiveWorkbook.Name
'Worksheets("Materials").Visible = False
'Open Workbook
Workbooks.Open "\\TWS-VS1061\Template\IBMS\HQ FORMS\300 - Commercial\HQ 304 Estimate Summary (2018 Rates).XLSM"
'Change Dir.
ChDir "\\TWS-VS1061\Template\IBMS\HQ FORMS\300 - Commercial"
'Write Data
'Workbooks("Quotation Mk1.xlsm").Sheets("Materials").Copy Before:=Workbooks("HQ 304 Estimate Summary (2018 Rates).XLSM").Sheets(6)
Workbooks(wsname).Sheets("Materials").Copy Before:=Workbooks("HQ 304 Estimate Summary (2018 Rates).XLSM").Sheets(6)
Worksheets("BudgetSummary").Activate
Worksheets("BudgetSummary").Range("C12").Value = 11
Worksheets("BudgetSummary").Range("N25").Value = "=Materials!H65+AF32"
Worksheets("BudgetSummary").Range("E41").Value = "=Materials!I65"
'Worksheets("Materials").Visible = True
Worksheets("materials").PageSetup.PrintArea = "$A$1:$j$68"
End Sub
How could I do to export the tab "Delivery" at the same time along the tab "Materials", I am frying my brain for a few days but I cant find out a solution, any help please?? thank you in advance...