Bigblue1702
New Member
- Joined
- Aug 22, 2016
- Messages
- 2
All,
I am trying to create a macro that will work with a button to display either answers to a problem if the test has been completed or "Please finish the test before answers will be displayed".
Here is my current code
Sub Button_1()
Dim Answers As Range
Set Answers = Worksheets("Questions").Range("B21,H21,Q21,Y21,AD21,AL21,AU21,BF21,BQ21,CA21,CH21,CR21,DB21,DJ21,DS21,ED21")
If Application.WorksheetFunction.CountBlank(Answers) > 0 Then
MsgBox "Please finish the test before answers will be displayed"
Else
MsgBox "Test" 'This display will be replaced with specific answers to specific questions....
End If
End Sub
Based on a couple hours of debugging and research I believe it has something to do with how I am defining my objects at the top. I am tech/excel savy and have some lite background in programming on a general engineering-level, but I am no master by any means. Any help would be greatly appreciated. Thanks!
I am trying to create a macro that will work with a button to display either answers to a problem if the test has been completed or "Please finish the test before answers will be displayed".
Here is my current code
Sub Button_1()
Dim Answers As Range
Set Answers = Worksheets("Questions").Range("B21,H21,Q21,Y21,AD21,AL21,AU21,BF21,BQ21,CA21,CH21,CR21,DB21,DJ21,DS21,ED21")
If Application.WorksheetFunction.CountBlank(Answers) > 0 Then
MsgBox "Please finish the test before answers will be displayed"
Else
MsgBox "Test" 'This display will be replaced with specific answers to specific questions....
End If
End Sub
Based on a couple hours of debugging and research I believe it has something to do with how I am defining my objects at the top. I am tech/excel savy and have some lite background in programming on a general engineering-level, but I am no master by any means. Any help would be greatly appreciated. Thanks!