LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Macro's checking for errors

Are there standard checks for errors that the macro's below should have?

An application is being built to be used by others and the following code
works when everything is entered correctly. I have tried to anticipate some
of the problems caused by individual not using valid information. Please
note that data validation is being used extensively on the input fields - to
ensure that valid data is being entered.


Sub Print_pages()
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Input" And sht.Visible = True Then
sht.PrintOut
End If
Next
End Sub

Sub change_agent()
Sheets("Agent_information").Visible = True
ActiveWorkbook.Worksheets("Agent_information").Sel ect
End Sub

Sub check_error()
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Input" Then
sht.Visible = False
End If
Next

If Range("input_info!valid").value < 0 Then
Sheets("input").[button 17].Visible = False
Beep
End If

If Range("input_info!valid").value = 0 Then
Sheets("input").[button 17].Visible = True
Sheets("input").[button 248].Visible = True
Select Case Range("product").value
Case Is = "Capital_Bonus_2"
Sheets("CB2_Disclosure").Visible = True
Sheets("CB2_Values").Visible = True
Case Is = "Maximum_Solutions_II"
Sheets("Max2_Disclosure").Visible = True
Sheets("Max2_Values").Visible = True
Case Is = "Expanding_Horizon_5"
Sheets("EH5_Disclosure").Visible = True
Sheets("EH5_Values").Visible = True
Case Is = "Expanding_Horizon_7"
Sheets("EH7_Disclosure").Visible = True
Sheets("EH7_Values").Visible = True
Case Is = "GPA_5Yr"
Sheets("GPA5_Disclosure").Visible = True
Sheets("GPA_Values").Visible = True
Case Is = "GPA_9Yr"
Sheets("GPA9_Disclosure").Visible = True
Sheets("GPA_Values").Visible = True
Case Is = "GPA_Seminole_County"
Sheets("GPASC_Disclosure").Visible = True
Sheets("GPA_Values").Visible = True
Case Is = "MY_Guaranteed_Solution_II"
Sheets("MYGS_Disclosure").Visible = True
Sheets("MYGS_Values").Visible = True
Sheets("input").[button 248].Visible = False
Case Else
MsgBox "Not a valid plan"
End Select
End If
End Sub

Sub monthly_income_benefit_accumulation()
Worksheets("input_info").Range("c50").GoalSeek
goal:=Worksheets("input_info").Range("c52"), _
Changingcell:=Worksheets("input").Range("c13")
Application.ScreenUpdating = True
Worksheets("input").Range("c13") =
Application.WorksheetFunction.RoundUp(Worksheets(" input").Range("c13"), 2)
If Worksheets("input").Range("c13") < 0 Then
Worksheets("input").Range("c13") = 0
End If
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I remove multiple 'errors' in Excel error checking, at the same time??? [email protected] Excel Discussion (Misc queries) 2 May 11th 23 11:42 AM
Hide Macro's in Toolbar / Macro's list sparx Excel Discussion (Misc queries) 2 May 6th 06 08:53 PM
Checking excel for errors/inconsistencies markx Excel Worksheet Functions 1 February 23rd 05 03:13 PM
checking errors in the formulas cawemann[_2_] Excel Programming 2 November 28th 03 03:03 PM
checking for errors in combobox's Bob C[_2_] Excel Programming 1 September 4th 03 09:03 PM


All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"