Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 08:54 PM.

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

About Us

"It's about Microsoft Excel"