Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Better ways but to quickly find out what's going wrong something like this -
Public gbDebug As Boolean Sub Test() Dim bOK As Boolean Dim s1$, s2$, s3 Dim n As Long gbDebug = True ' normally set in some other proc On Error GoTo errH: s1 = "aaa" s2 = "bbb" n = 1 / 0 s2 = "ccc" bOK = True done: MsgBox "All OK: " & bOK Exit Sub errH: If gbDebug Then Debug.Print "Err: " & Err.Number, Err.Description Debug.Print "s1: "; s1 Debug.Print "s2: "; s2 Debug.Print "s3: "; s3 Stop 'ctrl-g to view Immediate window ' F8 to step to line that triggered error ' or drag yellow cursor down to skip Resume End If Resume done End Sub Regards, Peter T "cereldine" wrote in message ... Sorry should have explained myself better, i have a lot of worksheets that open depending on a string value, there have been occassions when i have been debugging when these strings or search values have been blank, i thought that if i could output all the current strings with the value they hold at the time of error then i could narrow down problem. Perhaps a better way of putting it would be how do i return the values for all variables in my procedure at the time when code breaks? -- cereldine ------------------------------------------------------------------------ cereldine's Profile: http://www.excelforum.com/member.php...o&userid=32069 View this thread: http://www.excelforum.com/showthread...hreadid=554916 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
replace state names with state code abbreviations | Excel Worksheet Functions | |||
How can I show state-by-state data (as silos) on a map of NA | Charts and Charting in Excel | |||
Converting State Names to State Abbreviations | Excel Discussion (Misc queries) | |||
Type mismatch error problem when dealing with Strings | Excel Programming | |||
changing the message in an error message | Excel Worksheet Functions |