Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2005, 07:08 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default object defined error

heres my code..im trying to find all occurences of a part number. Its givign me an error with the portion of this code.
.
.
.
.
.
.

      r2.Select
        Selection.EntireRow.Select
        ActiveCell = r2
        Set r3 = ActiveCell

differentvendor:
    diffvend = MsgBox("Would you like to find another vendor with the same PTI Part number?", vbQuestion + vbYesNo)


    If diffvend = vbYes Then



        Do While Not IsEmpty(ActiveCell)
          MsgBox r3

        Range("PN").FindNext(r3).Select



        Selection.EntireRow.Select


        'If Range("PN").FindNext(r3) Is Nothing Then
            'sorry = MsgBox("Sorry, there are no more vendors for that PTI part number. Restart?", vbQuestion + vbYesNo)
         ' GoTo restart1

        GoTo differentvendor
.
.
.
.
.
.


 
Old February 1st, 2005, 01:26 AM
Authorized User
 
Join Date: Jan 2005
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please correct me if I am wrong. You are probably facing problem with the line of code:
Range("PN").FindNext(r3).Select

if this is so
replace this line with the following lines or (something like this!)

On error resume next
Range("PN").FindNext(r3).Select
On error goto 0
if activecell=r3 then .... else ....

I hope this would help.

Best regards

Amjad Mahmood
GSK Pakistan







Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
VB.net Database -> user defined object boneill VB How-To 4 May 2nd, 2005 05:23 PM
Application-defined or object-defined error James Excel VBA 1 August 12th, 2003 11:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.