LordVoldetort_IV
New Member
- Joined
- Jun 10, 2021
- Messages
- 38
- Office Version
- 365
- Platform
- Windows
Hello everyone!
So the below code works perfect in windows 10 and does what its supposed to, but i get errors when i try to run it in windows 11.
Any idea of what may be wrong and how to fix it?
Thanks!
So the below code works perfect in windows 10 and does what its supposed to, but i get errors when i try to run it in windows 11.
Any idea of what may be wrong and how to fix it?
Thanks!
VBA Code:
Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
End Sub
Private Sub Applychanges_Click()
With Worksheets("Tax Calculation")
'Last updated: 2021.04.09
'With function defines where to execute code
'BeginRow = from which row you want to start checking
'EndRow = to which row you want to check
'ChkCol = in which collom is the value to check
BeginRow = 1
EndRow = 400
ChkCol = 19
For RowCnt = BeginRow To EndRow
If Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).value = "HIDE" Then
Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else: Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End With
End Sub
Private Sub DTPicker2_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
End Sub
Private Sub CommandButton1_Click()
Dim dateVariable As Date
dateVariable = CalendarForm.GetDate
Dim cellRange As Range
Set cellRange = Range("K16")
cellRange.value = dateVariable
End Sub
Private Sub email_button_Click()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "xx@xx.co.za"
.Subject = "Individual's Tax Calc: errors and suggestions"
.Body = "<please describe the issue or suggestion here>"
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
On Error GoTo 0
End Sub
Private Sub FinalizeTC_Click()
With Worksheets("Tax Calculation")
'Last updated: 2021.04.09
'With function defines where to execute code
'BeginRow = from which row you want to start checking
'EndRow = to which row you want to check
'ChkCol = in which collom is the value to check
BeginRow = 1
EndRow = 400
ChkCol = 20
For RowCnt = BeginRow To EndRow
If Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).value = "HIDE" Then
Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
Next RowCnt
End With
End Sub
Private Sub UnhideAll_Click()
With Worksheets("Tax Calculation")
'Last updated: 2021.04.09
'With function defines where to execute code
'BeginRow = from which row you want to start checking
'EndRow = to which row you want to check
'ChkCol = in which collom is the value to check
BeginRow = 1
EndRow = 400
ChkCol = 19
For RowCnt = BeginRow To EndRow
If Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).value = "HIDE" Or Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).value = "SHOW" Then
Worksheets("Tax Calculation").Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End With
End Sub
Sub Worksheet_Change(ByVal Target As Range)
'this is for the investment income section
If Target.Address = "$D$36" Then
With Worksheets("Info Sheet")
'Last updated: 2021.04.09
'With function defines where to execute code
'BeginRow = from which row you want to start checking
'EndRow = to which row you want to check
'ChkCol = in which collom is the value to check
BeginRow = 1
EndRow = 110
ChkCol = 20
For RowCnt = BeginRow To EndRow
If Worksheets("Info Sheet").Cells(RowCnt, ChkCol).value = "HIDE" Then
Worksheets("Info Sheet").Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else: Worksheets("Info Sheet").Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End With
End If
End Sub