samohtwerdna
11-16-2005, 07:04 AM
I hate to bud in - but I have a question for killian on Excel Addins.
I want to create a worksheet that is formated and ready to print along with my Addin (user form) when the "Print Quote" button is pushed the worksheet is up dated and made active.
I was creating the sheet from code - but had a bit of formatting that took to long - So can I call my Sheet1 from my .xla from the current workbook??
Here is what I have:
Private Sub cmdPrint_Click()
Dim NewSheet As Worksheet, Cadsht As Worksheet
Set Cadsht = Worksheets(1)
Cadsht.Name = Worksheets(1).Name
'this is where I want to call my worksheet template
Set NewSheet = Worksheets(2)
NewSheet.Name = "Price Quote"
Range("a1").Select
With ActiveCell
.Offset(3, 1).Value = Cadsht.Name
.Offset(4, 0).Value = "Finish:"
.Offset(4, 1).Value = cboFinish.Value
.Offset(4, 2).Value = txtFinish.Value
.Offset(7, 0).Value = "Total Surface Area"
.Offset(7, 4).Value = lblTotl.Caption
.Offset(8, 0).Value = "Total Interior Area"
.Offset(8, 4).Value = lblTotl2.Caption
.Offset(10, 0).Value = "Grand Total List Price"
.Offset(10, 4).Value = txtQuoteTotal.Value
End With
End Sub
I want to create a worksheet that is formated and ready to print along with my Addin (user form) when the "Print Quote" button is pushed the worksheet is up dated and made active.
I was creating the sheet from code - but had a bit of formatting that took to long - So can I call my Sheet1 from my .xla from the current workbook??
Here is what I have:
Private Sub cmdPrint_Click()
Dim NewSheet As Worksheet, Cadsht As Worksheet
Set Cadsht = Worksheets(1)
Cadsht.Name = Worksheets(1).Name
'this is where I want to call my worksheet template
Set NewSheet = Worksheets(2)
NewSheet.Name = "Price Quote"
Range("a1").Select
With ActiveCell
.Offset(3, 1).Value = Cadsht.Name
.Offset(4, 0).Value = "Finish:"
.Offset(4, 1).Value = cboFinish.Value
.Offset(4, 2).Value = txtFinish.Value
.Offset(7, 0).Value = "Total Surface Area"
.Offset(7, 4).Value = lblTotl.Caption
.Offset(8, 0).Value = "Total Interior Area"
.Offset(8, 4).Value = lblTotl2.Caption
.Offset(10, 0).Value = "Grand Total List Price"
.Offset(10, 4).Value = txtQuoteTotal.Value
End With
End Sub