Private Sub worksheet_change(ByVal target As Range)
Dim rngEntityType As Range
Dim rngLargeCompany As Range
Dim rngNoCount As Range
Dim rngYesCount As Range
Set rngEntityType = Range("Entity_Type")
'When entity type is recorded it will show the correct fields to enter the data
If Not Intersect(target, rngEntityChanged) Is Nothing Then
If Range("Entity_Type").Value = "Company" Then
'Shows Large Company questionaire, if company is selected
ActiveSheet.Range("LargeCompany").Hidden = False
Else
'Shows General Purpose questionaire, if company is not selected
ActiveSheet.Range("GeneralPurpose").Hidden = False
End If
End If
Set rngEntityChanged = Nothing
Set rngLargeCompany = Range("LargeCompany5")
'When this last bit of data is entered it will move you onto next questionaire
If Not Intersect(target, rngLargeCompany) Is Nothing Then
If Range("LargeCompany4") = "Yes" Or Range("LargeCompany5") = "Yes" Then
'Shows Publically Accountable questionaire,
'if yes is entered in question 4 or 5 of the Large Company Questionaire
ActiveSheet.Range("PublicallyAccountable").Hidden = False
End If
Else
For Each cell In Range("LargeCompany1, LargeCompany2, LargeCompany3")
If cell.Value = "No" Then rngNoCount = rngNoCount + 1
Next cell
If rngNoCount >= 2 And Range("LargeCompany4") = "No" And Range("LargeCompany5") = "No" Then
MsgBox "Exempt Company" & vbNewLine & "(Financial Reporting Act)"
rngNoCount = 0
Else
For Each cell In Range("LargeCompany1, LargeCompany2, LargeCompany3")
If cell.Value = "Yes" Then rngYesCount = rngYesCount + 1
Next cell
If rngYesCount >= 2 And Range("LargeCompany4") = "No" And Range("LargeCompany5") = "No" Then
ActiveSheet.Range("PublicallyAccountable").Hidden = False
rngYesCount = 0
End If
End If
End If
End Sub