-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSheet2.bas
124 lines (94 loc) · 2.82 KB
/
Sheet2.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Rem Attribute VBA_ModuleType=VBADocumentModule
Option VBASupport 1
Private Sub cmdGenerate_Click()
Module3.Create_XML
End Sub
Private Sub cmdNext_Click()
ThisComponent.CurrentController.setActiveSheet(ThisComponent.Sheets(3-1))
End Sub
Private Sub cmdPrev_Click()
ThisComponent.CurrentController.setActiveSheet(ThisComponent.Sheets(0))
End Sub
Private Sub cmdHelp_Click()
Sheet30.Visible = xlSheetVisible
Sheet30.Activate
'Sheet30.Range("i_general2").Select
End Sub
Private Sub cmdPrint_Click()
Module3.PrintWorksheets
End Sub
Private Sub cmdValidate_Click()
Module3.printerrormessage_IncD
End Sub
Private Sub CommandButton1_Click()
Module3.PrintWorksheets
End Sub
Private Sub CommandButton4_Click()
Module3.printerrormessage_IncD
End Sub
Private Sub cmdVallidate_Click()
Module3.printerrormessage_IncD
End Sub
' For Sheet : GENERAL2
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo exit1
Application.EnableEvents = False
If Target.Validation.Type = 3 Then
GoTo exit1
End If
If (getRangeName(Target) = "Ver.PAN") Then
Target.value = UCase(Target.value)
End If
Target.value = UCase(Target.value)
Target.Formula = UCase(Target.Formula)
If (Val(ThisComponent.Sheets(2-1).getCellRangeByName("IncD.RefundDue"))) > 0 Then
If (Range("IncD.EcsRequired").value = "No") Then
If (Not (Range("IncD.MICRCode").value = "")) Or (Not (Range("IncD.BankAccountType").value = "")) Then
MsgBox "If refund is by cheque then MICR Code and Type of account must not be filled"
Range("IncD.MICRCode").value = ""
Range("IncD.BankAccountType").value = ""
End If
End If
End If
'Else
' MsgBox "If no Refund due then Bank details not required "
' Range("IncD.BankAccountNumber").Value = ""
' Range("IncD.EcsRequired").Value = "No"
' Range("IncD.MICRCode").Value = ""
' Range("IncD.BankAccountType").Value = ""
'GoTo exit1
'End If
If (getRangeName(Target) = "TDSal.TAN") Then
If Not (ValidateTAN_TDSal()) Then
MsgBox "INVALID TAN"
End If
GoTo exit1
End If
If (getRangeName(Target) = "TDSoth.TAN") Then
If Not (ValidateTAN_TDSoth()) Then
MsgBox "INVALID TAN"
End If
GoTo exit1
End If
If (getRangeName(Target) = "TaxP.DateDep") Then
If Not (ValidateDateDep_TaxP()) Then
MsgBox "INVALID DateDep"
End If
GoTo exit1
End If
exit1:
Application.EnableEvents = True
End Sub
Function getRangeName(ByVal Target As Range) As String
Dim start As Integer
start = Len(Target.Name)
If InStr(1, Target.Name.Name, "'") > 0 Then
start = start + 3 + 1
Else
start = start + 1 + 1
End If
If InStr(1, Target.Name.Name, ThisComponent.CurrentController.getActiveSheet.Name) = 0 Then
start = 1
End If
getRangeName = Mid(Target.Name.Name, start)
End Function