Printing preview

. 1  Sub Browse_Click ()
 2      ' print information 
. 3      Dim the columnCount of As  Integer  ' columns 
. 4      Dim the rowCount of As  Integer   ' rows 
. 5      the columnCount = the getColumnCount (XsXxSheet)
 . 6      the rowCount = Application.CountA (ActiveSheet.Range ( " B: B " ))
 . 7      the If the rowCount = 0  the Then 
. 8          MsgBox ( " no data, without printing! " )
 . 9          the Exit Sub 
10      End  the If
. 11      the If the rowCount = . 1  the Then 
12 is          MsgBox ( " no data, without printing! " )
 13 is          the Exit Sub 
14      End  the If 
15      
16      Worksheets ( " student information print template " ) .Visible = True 
. 17      ' and ejects prompt window 
18      ' Cycle 1 - - OK 
. 19       the For RO = 2  the to  2 
20 is          ' circular column filled student template information 2-- -> generates a new Excel 
21 is         the For COL = . 1  the to the columnCount
 22 is            Title = Sheets(XsXxSheet).Cells(1, col)
23            If Title <> "" Then
24              Dim content As String
25              content = Sheets(XsXxSheet).Cells(ro, col)
26              Dim exl As TypeValueCell
27              exl.cellName = Title
28              exl.cellContent = content
29              aa = fileXsExportModel(exl)
30            End If
31         Next col
32     Next ro
33     Worksheets ( " student information print template " ) .PrintPreview
 34 is      ' empty template 
35       the For COL = . 1  the To the columnCount
 36           the Title = Sheets (XsXxSheet) .Cells ( . 1 , COL)
 37 [           the If the Title <> ""  the Then 
38 is             Dim content2 of As  String 
39             Sheets = content2 (XsXxSheet) .Cells ( 2 , COL)
 40             Dim exl2 of As TypeValueCell
 41 is             exl2.cellName = the Title
 42 is            = exl2.cellContent content1
 43             bb = clearXsExportModel (exl2)
 44           End  the If 
45        the Next COL
 46      Worksheets ( " student information Print template " ) .Visible = False 
47  End Sub

 

Guess you like

Origin www.cnblogs.com/xiehaofeng/p/11616951.html