Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to Error Handleing
I am trying to write a macro to remove duplicate records from a cs
file. The problem that I am having is that I am trying to allow th user to select a range via an input box: dim check as range Set check = Application.InputBox(prompt:="Select with the Mouse th Area you would like to check for Duplicates.", Type:=8) That works fine, but If the user hit's cancel then the the macro error out with a runtime error 424 Object required. Any Recomendations -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to Error Handleing
Of course.
Dim Check As Range On Error Resume Next Set Check = Application.InputBox(prompt:="Select with the Mouse the Area you would like to check for Duplicates.", Type:=8) On Error Goto 0 If Not Check Is Nothing Then 'your codeEnd If -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "pkohler " wrote in message ... I am trying to write a macro to remove duplicate records from a csv file. The problem that I am having is that I am trying to allow the user to select a range via an input box: dim check as range Set check = Application.InputBox(prompt:="Select with the Mouse the Area you would like to check for Duplicates.", Type:=8) That works fine, but If the user hit's cancel then the the macro errors out with a runtime error 424 Object required. Any Recomendations? --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
New to Error Handleing
Thanks for that tip, it worked great! However I am running into a ne
problem. Sometimes, Mouse entry stops working. I.E. when you try t click on the range, it doesn't let you. You can still type in a rang though. It is seemingly random and when it happens you either need t restart excel or restart your computer. Has anyone ever seen this -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 - error saving file & error loading dll | Excel Discussion (Misc queries) | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming |