?? frmyjzzs.frm
字號:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmyjzzs
BorderStyle = 1 'Fixed Single
Caption = "應交增值稅明細表"
ClientHeight = 6435
ClientLeft = -1140
ClientTop = 960
ClientWidth = 9270
ClipControls = 0 'False
ControlBox = 0 'False
Icon = "frmyjzzs.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6435
ScaleWidth = 9270
Begin VB.TextBox Text1
BeginProperty DataFormat
Type = 1
Format = "0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
Height = 270
Left = 0
TabIndex = 13
Text = "Text1"
Top = 45
Visible = 0 'False
Width = 465
End
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 5055
Left = 135
TabIndex = 12
Top = 450
Width = 9015
_ExtentX = 15901
_ExtentY = 8916
_Version = 393216
Rows = 22
Cols = 4
FixedCols = 2
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "關閉(&C)"
Height = 360
Left = 8040
TabIndex = 11
Top = 5985
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "打印(&P)"
Height = 345
Left = 8025
TabIndex = 10
Top = 5580
Width = 1095
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 300
Left = 6165
TabIndex = 5
Top = 45
Width = 1695
_ExtentX = 2990
_ExtentY = 529
_Version = 393216
Format = 58654720
CurrentDate = 37215
End
Begin VB.TextBox Text2
Height = 300
Left = 1485
TabIndex = 4
Top = 90
Width = 2775
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "3.小規模納稅人應交數在第6行,本月交本月數填在第13行,本月交上月數填在第18行。"
Height = 180
Left = 705
TabIndex = 9
Top = 6150
Width = 6930
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "2.本表“未交增值稅”各項目,應根據“應交稅金—未交增值稅”伴目的有關記錄填列。"
Height = 180
Left = 705
TabIndex = 8
Top = 5955
Width = 7020
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "1.本表“應交增值稅”各項目,應根據“應交稅金—應交增值稅”科目有關志欄的記錄填列。"
Height = 180
Left = 705
TabIndex = 7
Top = 5760
Width = 7380
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "編制說明:"
Height = 180
Left = 345
TabIndex = 6
Top = 5550
Width = 810
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Height = 180
Left = 8220
TabIndex = 3
Top = 165
Width = 90
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "填表日期:"
Height = 180
Left = 5220
TabIndex = 2
Top = 105
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "單位名稱:"
Height = 180
Left = 540
TabIndex = 1
Top = 135
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "01表附表1"
Height = 180
Left = 8220
TabIndex = 0
Top = 105
Width = 810
End
End
Attribute VB_Name = "frmyjzzs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const ASC_ENTER = 13 '回車
Dim gRow As Integer
Dim gCol As Integer
Dim zsbexcel As Excel.Application
Private Sub Command1_Click()
'On Error GoTo errorhandler
Dim t As Integer
Dim j As Integer
Set zsbexcel = New Excel.Application
zsbexcel.Visible = True
' Set zsbexcel = Nothing
zsbexcel.SheetsInNewWorkbook = 1
Set zsbworkbook = zsbexcel.Workbooks.Open(App.Path + "\" + "sheet\yjzzs.xlt")
With zsbexcel.ActiveSheet
.Range("A3").Value = "單位名稱:" + Text2
.Range("B3").Value = "填表日期:" + Format(DTPicker1, "yyyy-MM-dd") 'Format(DTPicker1.Value) 'Year + "-" + DTPicker1.Month + "-" + DTPicker1.Day
'.Range("G6").Value = DTPicker1.Month
'.Range("J6").Value = DTPicker1.Day
For t = 5 To 24
If t = 6 Or t = 20 Or t = 22 Or t = 23 Then
t = t + 1
Else
End If
Grid1.Row = t - 4
'For j = 2 To 3
Grid1.Col = 2
a = "C" + CStr(t)
'If IsNull(Grid1.Text) = False Then
.Range(a) = Grid1.Text
'End If
'Next j
Next t
For j = 5 To 25
Grid1.Row = j - 4
'For j = 2 To 3
Grid1.Col = 3
b = "D" + CStr(j)
.Range(b) = Grid1.Text
'If IsNull(Grid1.Text) = False Or Grid1.Text = "×" Then
'.Range(b) = ""
'.Range(a) = ""
'End If
'Next j
Next j
End With
'dd = MsgBox("yes or no", vbYesNo + vbSystemModal)
'If dd = vbNo Then Exit Sub
' zsbexcel.ActiveSheet.PageSetup.Orientation = xlPortrait 'xlLandscape
'zsbexcel.ActiveSheet.PageSetup.PaperSize = xlPaperA4
zsbexcel.Caption = "打印預覽"
zsbexcel.ActiveWindow.SelectedSheets.PrintPreview
'zsbexcel.ActiveSheet.PrintOut
zsbexcel.DisplayAlerts = False
zsbexcel.Quit
zsbexcel.DisplayAlerts = True
Set zsbexcel = Nothing
Exit Sub
'errorhandler:
'MsgBox "請正確安裝EXCEL!", vbOKOnly + vbCritical
'Exit Sub
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text2 = frmqy.qymc
DTPicker1 = Date
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
'SSTab1.Tab = 0
Grid1.TextMatrix(0, 0) = " 項 目"
Grid1.TextMatrix(0, 1) = " 行數"
Grid1.TextMatrix(0, 2) = " 本月數"
Grid1.TextMatrix(0, 3) = " 本年累計數"
Grid1.TextMatrix(1, 0) = "一、應交增值稅:"
Grid1.TextMatrix(2, 0) = " 1、年初未抵扣數(用“—”號填列”)"
Grid1.TextMatrix(2, 1) = " 1"
Grid1.TextMatrix(3, 0) = " 2、銷項稅額"
Grid1.TextMatrix(3, 1) = " 2"
Grid1.TextMatrix(4, 0) = " 出口退稅"
Grid1.TextMatrix(4, 1) = " 3"
Grid1.TextMatrix(5, 0) = " 進項稅額轉出"
Grid1.TextMatrix(5, 1) = " 4"
Grid1.TextMatrix(6, 0) = " 轉出多交增值稅"
Grid1.TextMatrix(6, 1) = " 5"
Grid1.TextMatrix(7, 1) = " 6"
Grid1.TextMatrix(8, 1) = " 7"
Grid1.TextMatrix(9, 0) = " 3、進項稅額"
Grid1.TextMatrix(9, 1) = " 8"
Grid1.TextMatrix(10, 0) = " 已交稅金"
Grid1.TextMatrix(10, 1) = " 9"
Grid1.TextMatrix(11, 0) = " 減免稅款"
Grid1.TextMatrix(11, 1) = " 10"
Grid1.TextMatrix(12, 0) = " 出口抵減內銷產品應納稅額"
Grid1.TextMatrix(12, 1) = " 11"
Grid1.TextMatrix(13, 0) = " 轉出未交增值稅"
Grid1.TextMatrix(13, 1) = " 12"
Grid1.TextMatrix(14, 1) = " 13"
Grid1.TextMatrix(15, 1) = " 14"
Grid1.TextMatrix(16, 0) = " 4、期末未交數(多交數以“—”號填列)"
Grid1.TextMatrix(16, 1) = " 15"
Grid1.TextMatrix(17, 0) = "二、未交增值稅:"
Grid1.TextMatrix(18, 0) = " 1、年初未交數(多交數以“—”號填列)"
Grid1.TextMatrix(18, 1) = " 16"
Grid1.TextMatrix(19, 0) = " 2、本期轉入數(轉入多交數以“—”號填列)"
Grid1.TextMatrix(19, 1) = " 17"
Grid1.TextMatrix(20, 0) = " 3、本期已交數"
Grid1.TextMatrix(20, 1) = " 18"
Grid1.TextMatrix(21, 0) = " 4、期末未交數(多交數以“—”號填列)"
Grid1.TextMatrix(21, 1) = " 19"
Grid1.ColWidth(0) = (Grid1.Width / 4) + 1700
Grid1.ColWidth(1) = (Grid1.Width / 4) - 1100
Grid1.ColWidth(2) = (Grid1.Width / 4) - 370
Grid1.ColWidth(3) = (Grid1.Width / 4) - 370
For i = 1 To 21
Grid1.TextMatrix(i, 2) = Format(0, "###0.00")
Grid1.TextMatrix(i, 3) = Format(0, "###0.00")
Next i
'Grid1.Row = 1
'Grid1.Col = 2
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(1, 2) = ""
'Grid1.Row = 1
'Grid1.Col = 3
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(1, 3) = ""
'Grid1.Row = 7
'Grid1.Col = 3
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(7, 3) = ""
'Grid1.Row = 7
'Grid1.Col = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(7, 2) = ""
'Grid1.Row = 8
'Grid1.Col = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(8, 2) = ""
'Grid1.Row = 8
'Grid1.Col = 3
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(8, 3) = ""
'Grid1.Row = 14
'Grid1.Col = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(14, 2) = ""
'Grid1.Row = 14
'Grid1.Col = 3
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(14, 3) = ""
'Grid1.Row = 15
'Grid1.Col = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(15, 2) = ""
'Grid1.Row = 15
'Grid1.Col = 3
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(15, 3) = ""
'Grid1.Row = 17
'Grid1.Col = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(17, 2) = ""
'Grid1.Row = 17
'Grid1.Col = 3
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(17, 3) = ""
'Grid1.Row = 2
'Grid1.Col = 2
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(2, 2) = " ×"
'Grid1.Row = 16
'Grid1.Col = 2
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(16, 2) = " ×"
'Grid1.Row = 18
'Grid1.Col = 2
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(18, 2) = " ×"
'Grid1.Row = 21
'Grid1.Col = 2
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
'Grid1.CellBackColor = &HE0E0E0
Grid1.TextMatrix(21, 2) = " ×"
Grid1.Row = 19
Grid1.Col = 2
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
Grid1.CellBackColor = &HE0E0E0
Grid1.Row = 19
Grid1.Col = 3
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
Grid1.CellBackColor = &HE0E0E0
Grid1.Row = 21
Grid1.Col = 3
'Grid1.CellForeColor = vbRed
'Grid1.CellType = 2
Grid1.CellBackColor = &HE0E0E0
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = ASC_ENTER Then
Grid1.SetFocus ' Set focus back to grid, see Text_LostFocus.
KeyAscii = 0 ' Ignore this KeyPress.
End If
If KeyAscii <> 8 And KeyAscii <> 45 And KeyAscii <> 46 And KeyAscii < 48 Or KeyAscii > 57 Then
' 'Beep
KeyAscii = 0
End If
End Sub
Private Sub Text1_LostFocus()
On Error GoTo errorhandler
Dim tmpRow As Integer
Dim tmpCol As Integer
' Save current settings of Grid Row and col. This is needed only if
' the focus is set somewhere else in the Grid.
tmpRow = Grid1.Row
tmpCol = Grid1.Col
' Set Row and Col back to what they were before Text1_LostFocus:
Grid1.Row = gRow
Grid1.Col = gCol
Grid1.Text = Format(Val(Text1.Text), "###0.00") ' Transfer text back to grid.
Text1.SelStart = 0 ' Return caret to beginning.
Text1.Visible = False ' Disable text box.
' Return row and Col contents:
Grid1.Row = tmpRow
Grid1.Col = tmpCol
Grid1.TextMatrix(19, 2) = Format(Val(Grid1.TextMatrix(13, 2)), "###0.00")
Grid1.TextMatrix(19, 3) = Format(Val(Grid1.TextMatrix(13, 3)), "###0.00")
Grid1.TextMatrix(21, 3) = Format(Val(Grid1.TextMatrix(2, 3)) + Val(Grid1.TextMatrix(3, 3)) + Val(Grid1.TextMatrix(5, 3)) - Val(Grid1.TextMatrix(9, 3)) - Val(Grid1.TextMatrix(20, 3)) + Val(Grid1.TextMatrix(18, 3)), "###0.00")
Exit Sub
errorhandler:
Exit Sub
End Sub
Private Sub Grid1_DblClick()
' Move the text box to the current grid cell:
Text1.Top = Grid1.CellTop + Grid1.Top
Text1.Left = Grid1.CellLeft + Grid1.Left
' Save the position of the grids Row and Col for later:
gRow = Grid1.Row
gCol = Grid1.Col
If gRow = 1 And gCol = 2 Then Exit Sub
If gRow = 1 And gCol = 3 Then Exit Sub
If gRow = 7 And gCol = 3 Then Exit Sub
If gRow = 7 And gCol = 2 Then Exit Sub
If gRow = 8 And gCol = 2 Then Exit Sub
If gRow = 8 And gCol = 3 Then Exit Sub
If gRow = 14 And gCol = 2 Then Exit Sub
If gRow = 14 And gCol = 3 Then Exit Sub
If gRow = 15 And gCol = 2 Then Exit Sub
If gRow = 15 And gCol = 3 Then Exit Sub
If gRow = 17 And gCol = 2 Then Exit Sub
If gRow = 17 And gCol = 3 Then Exit Sub
If gRow = 2 And gCol = 2 Then Exit Sub
If gRow = 16 And gCol = 2 Then Exit Sub
If gRow = 18 And gCol = 2 Then Exit Sub
If gRow = 21 And gCol = 2 Then Exit Sub
If gRow = 21 And gCol = 3 Then Exit Sub
If gRow = 19 And gCol = 2 Then Exit Sub
If gRow = 19 And gCol = 3 Then Exit Sub
' Make text box same size as current grid cell:
Text1.Width = Grid1.CellWidth '- 2 * Screen.TwipsPerPixelX
Text1.Height = Grid1.CellHeight ' - 2 * Screen.TwipsPerPixelY
' Transfer the grid cell text:
Text1.Text = Grid1.Text
' Show the text box:
Text1.Visible = True
Text1.ZOrder 0 ' 把 Text1 放到最前面!
Text1.SetFocus
' Redirect this KeyPress event to the text box:
If KeyAscii <> ASC_ENTER Then
SendKeys Chr$(KeyAscii)
End If
End Sub
Private Sub Grid1_KeyPress(KeyAscii As Integer)
Call Grid1_DblClick
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -