LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default keep track of last code line before error

Hi Bart,

Need Line numbers but no need to increment a variable.

Sub test()
On Error GoTo errH

10 x = x + 1
20 x = x + 2
30 x = x / 0
40 x = x + 1
x = x + 1
x = x / 0
50 x = x + 1

Exit Sub
60 x = 10

Exit Sub
errH:
If Erl = 30 Then
Resume Next
Else
MsgBox Erl
GoTo 60
End If
End Sub


Regards,
Peter T


"RB Smissaert" wrote in message
...
Is it possible somehow to keep track of the last line of code that was run
before a handled error occured without
adding line numbers or without adding a public variable that gets
incremented before every line?
I was thinking of perhaps a class handling VBE events, but I think I will
need the public variable.
I am not keen to add line numbers.

RBS



 
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 to track bottom line results over time for a trend plot? Joe Bailey Excel Discussion (Misc queries) 0 August 17th 06 06:26 AM
Need help - track changes code needs tweaking purpleme3 Excel Programming 0 December 13th 05 11:46 PM
Keeping track of code Eric White[_2_] Excel Programming 4 June 9th 05 09:41 AM
On Error, Capturing current module and actual line of code Paul Martin Excel Programming 4 June 13th 04 06:21 AM
Highlight Track Changes with VBA Code? Garp Excel Programming 1 December 23rd 03 01:32 PM


All times are GMT +1. The time now is 05:31 PM.

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"