ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error trap X 2 (https://www.excelbanter.com/excel-programming/441166-re-error-trap-x-2-a.html)

David

Error trap X 2
 
Hi OssieMac,

Thanks for your help. The problem was that the error did not want to reset.
I used Err.Clear and thought that would fix it.

I found an example which allowed me to use a Set Statement and Find, which
changed the code completely. Thank you for your time and efforts.

Thanks,
--
David


"OssieMac" wrote:

Hi again David,

If attempting to test the code I posted then change the Find code to following

myDateToFind = DateValue _
(Application.InputBox _
(Prompt:=myPrompt, _
Title:="Date entry.", _
Type:=2))

Initially I had myDateToFind dimensioned as a date and changed it to variant
for the cancel and then vba does not like it.


--
Regards,

OssieMac


"David" wrote:

Hi Group,

I am trapping an error:
On Error GoTo DateChange:

The Error occurs when I am searching for a date which is part of a
"QueryTables".
It works fine when the error only occurs 1 time and in the DateChange:(The
error trapping rountine) I am trying several things:
Err.Clear
On Error GoTo DateChange:

I was hoping this would clear the error and retrap when it occurs again, but
this all fails. Any ideas that allow it to continue to trap the errors would
be appreciated.

Thanks,
--
David



All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com