Hello everyone. Thank you again for all of your help on my previous thread:
http://www.excelforum.com/excel-prog...on-update.html
Here is the followup / Next steps that I will be working on.
Here was the code I am currently working with:
Private Sub worksheet_calculate()
Dim Person As Integer, ACCT As Integer, SCOPE As Integer
Application.EnableEvents = False
Person = Worksheets("Creation").Range("F6").Value + 12
Sheets("Creation").Rows("13:21").EntireRow.Hidden = True
Sheets("Creation").Rows("13:" & Auditors).EntireRow.Hidden = False
If Range("H6").Value <> "AMI" Then
Sheets("Creation").Rows("23:25").EntireRow.Hidden = False
Sheets("Creation").Range("B23").Value = Sheets("Creation").Range("H6").Value & " - Worksheet"
If Range("B25") > 0 Then
ACCT = Worksheets("Creation").Range("B25").Value
Sheets("Creation").Rows("26:" & ACCT + 27).EntireRow.Hidden = False
Else
Sheets("Creation").Rows("26:47").EntireRow.Hidden = True
End If
If Range("F25") > 0 Then
SCOPE = Worksheets("Creation").Range("F25").Value
Sheets("Creation").Rows("49:" & 50 + SCOPE).EntireRow.Hidden = False
Else
Sheets("Creation").Rows("49:60").EntireRow.Hidden = True
End If
Else
Sheets("Creation").Rows("23:60").EntireRow.Hidden = True
End If
Application.EnableEvents = True
End Sub
My questions are two fold, as mentioned in the title:
Foremost, it was recommended on the other thread that I should include an error handling routine while I work on the code for instances where things simply don't work as intended. I have created a separate sub with Application.enableEvents = True, but was the error handling routine that was recommended I place into the sheet more automated than running a separate macro?
Secondly, this VBA works well, however, I'm having problems if I have two worksheets open. Is there a way to bind this VBA to the single workbook, rather than all excel workbooks open in the Excel instance?
And again, thank you everyone for your help on this project of mine. I'm sure there will be many more questions to follow as I continue to work on this.
Bookmarks