Hi Guys,
Hope you are well. I keep on going around in circles and really need some help.
Okay, so I have got two worksheets. The first worksheet is called 'sheet1' and has two checkbox's called 'check1' and 'check2' and a button which pressed, executes the below code. The second worksheet is called 'results'.
The worksheet 'results' is as follows : A1 = Monday, B1 = 1, C1 = 1
A2 = Tuesday, B2 = 1, C2 = -4146
A3 = Wednesday, B3 = -4146, C3 = 1
A4 = Thursday,B4 = -4146, C4 = -4146
Depending on the checkboxes ticked I want the below result to appear in ‘sheet1’:
1)Check1 = ticked, check2 = ticked=> A1 = Monday, B1 = 1, C1 = 1 (works fine)
2)Check1 = ticked, check2 = not ticked=> A1 = Monday, B1 = 1, C1 = 1
A2 = Tuesday, B2 = 1, C2 = -4146 (does not work)
3)Check1 = not ticked, check2 = ticked=> A1 = Monday, B1 = 1, C1 = 1
A2 = Wednesday, B2 = -4146, C2 = 1(does not work)
4)Check1 = not ticked, check2 = not ticked=>A1 = Thursday,B1 = -4146, C1 = -4146 (works fine)
I am not sure where I am going wrong. I searched all over the web and loads of forums and can’t find a solution. It probably something really easy for you guys to resolve
If you could help me, I would greatly appreciated it!
Thanks
Chaz
****CODE*********
Sub Macro1()
Dim w As Long
Dim s As Long
w = 1
s = 1
Do While Worksheets("results").Range("A" & w) <> ""
If ActiveSheet.Shapes("check1").ControlFormat.Value = Worksheets("results").Range("B" & w) And ActiveSheet.Shapes("check2").ControlFormat.Value = Worksheets("results").Range("C" & w) Then
Worksheets("sheet1").Range("A" & s) = Worksheets("results").Range("A" & w)
Worksheets("sheet1").Range("B" & s) = Worksheets("results").Range("B" & w)
Worksheets("sheet1").Range("C" & s) = Worksheets("results").Range("C" & w)
s = s + 1
End If
w= w + 1
Loop
End Sub
Hope you are well. I keep on going around in circles and really need some help.
Okay, so I have got two worksheets. The first worksheet is called 'sheet1' and has two checkbox's called 'check1' and 'check2' and a button which pressed, executes the below code. The second worksheet is called 'results'.
The worksheet 'results' is as follows : A1 = Monday, B1 = 1, C1 = 1
A2 = Tuesday, B2 = 1, C2 = -4146
A3 = Wednesday, B3 = -4146, C3 = 1
A4 = Thursday,B4 = -4146, C4 = -4146
Depending on the checkboxes ticked I want the below result to appear in ‘sheet1’:
1)Check1 = ticked, check2 = ticked=> A1 = Monday, B1 = 1, C1 = 1 (works fine)
2)Check1 = ticked, check2 = not ticked=> A1 = Monday, B1 = 1, C1 = 1
A2 = Tuesday, B2 = 1, C2 = -4146 (does not work)
3)Check1 = not ticked, check2 = ticked=> A1 = Monday, B1 = 1, C1 = 1
A2 = Wednesday, B2 = -4146, C2 = 1(does not work)
4)Check1 = not ticked, check2 = not ticked=>A1 = Thursday,B1 = -4146, C1 = -4146 (works fine)
I am not sure where I am going wrong. I searched all over the web and loads of forums and can’t find a solution. It probably something really easy for you guys to resolve
If you could help me, I would greatly appreciated it!

Thanks
Chaz
****CODE*********
Sub Macro1()
Dim w As Long
Dim s As Long
w = 1
s = 1
Do While Worksheets("results").Range("A" & w) <> ""
If ActiveSheet.Shapes("check1").ControlFormat.Value = Worksheets("results").Range("B" & w) And ActiveSheet.Shapes("check2").ControlFormat.Value = Worksheets("results").Range("C" & w) Then
Worksheets("sheet1").Range("A" & s) = Worksheets("results").Range("A" & w)
Worksheets("sheet1").Range("B" & s) = Worksheets("results").Range("B" & w)
Worksheets("sheet1").Range("C" & s) = Worksheets("results").Range("C" & w)
s = s + 1
End If
w= w + 1
Loop
End Sub