Hello all,
I'm pretty new to vba so I've been searching the forums and have found most of what I've needed. However, there is one item I can't seem to figure out. When I check or uncheck a checkbox I want the cell that checkbox is linked to, to become active so the rest of the code runs on that row. As you can see I've written the code so I can use it for several checkboxes without having to make each one different. I want the code to run on the row that is associated with the checkbox's linked cell, make sense? Any help is greatly appreciated. There is more code that follows but it basically just repeats depending on the value of column F. I have also attached the template.Checkbook 2013_101.xlsm
Sub Check_To_Complete_Calculations()
Dim Rng As Range
Application.ScreenUpdating = False
ActiveSheet.Unprotect
ActiveCheckBox.Selection.Offset(, 1).Select
Set Rng = Sheets("Register").Rows(ActiveCell.Row).Columns("B:I")
If Sheets("Register").Rows(ActiveCell.Row).Columns("M").Value = False Then
Sheets("Register").Rows(ActiveCell.Row).Columns("B:K").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0
.PatternTintAndShade = 0
Rng.Locked = False
End With
ActiveSheet.Protect
Else
Sheets("Register").Rows(ActiveCell.Row).Columns("B:K").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
Rng.Locked = True
End With
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
If Sheets("Register").Rows(ActiveCell.Row).Columns("M").Value = False And Sheets("Register").Rows(ActiveCell.Row).Columns("F").Value = ("Daniels Pay") Then
ActiveCell.Select
Application.Run ("Module2.EAddAll_1")
Else
If Sheets("Register").Rows(ActiveCell.Row).Columns("M").Value = True And Sheets("Register").Rows(ActiveCell.Row).Columns("F").Value = ("Daniels Pay") Then
ActiveCell.Select
Sheets("Budget").Range("E56").Value = Sheets("Register").Rows(ActiveCell.Row).Columns("I").Value
Application.Run ("Module2.EAddAll1")
Else
If Sheets("Register").Rows(ActiveCell.Row).Columns("M").Value = False And Sheets("Register").Rows(ActiveCell.Row).Columns("F").Value = ("Karas Pay") Then
Application.Run ("Module2.FAddAll_1")
Else
If Sheets("Register").Rows(ActiveCell.Row).Columns("M").Value = True And Sheets("Register").Rows(ActiveCell.Row).Columns("F").Value = ("Karas Pay") Then
Sheets("Budget").Range("F56").Value = Sheets("Register").Rows(ActiveCell.Row).Columns("I").Value
Application.Run ("Module2.FAddAll1")
Else
If Sheets("Register").Rows(ActiveCell.Row).Columns("M").Value = False And Sheets("Register").Rows(ActiveCell.Row).Columns("F").Value = ("Church") Then
Sheets("Budget").Range("D4").Value = Sheets("Budget").Range("D4").Value - Sheets("Register").Rows(ActiveCell.Row).Columns("I").Value + Sheets("Register").Rows(ActiveCell.Row).Columns("H").Value
Else
If Sheets("Register").Rows(ActiveCell.Row).Columns("M").Value = True And Sheets("Register").Rows(ActiveCell.Row).Columns("F").Value = ("Church") Then
Sheets("Budget").Range("D4").Value = Sheets("Budget").Range("D4").Value + Sheets("Register").Rows(ActiveCell.Row).Columns("I").Value - Sheets("Register").Rows(ActiveCell.Row).Columns("H").Value
Else
Bookmarks