+ Reply to Thread
Results 1 to 4 of 4

Comparing a string to values in an array resulting in a Run time Error 1004

  1. #1
    Registered User
    Join Date
    06-03-2009
    Location
    California
    MS-Off Ver
    Excel 2000
    Posts
    20

    Comparing a string to values in an array resulting in a Run time Error 1004


    All,

    This workbook is designed to prompt the user with inputboxes allowing them to enter a name, hyperlink a file to that name, and then a date. Next all the drawing names are read into an array and stored. Along with some minor sheet formatting, this is what happens when the button "Add Drawing" is clicked.

    Next, when the button "Revise Drawing" is clicked, the user will be prompted with an inputbox for a drawing name. This name will be compared to the names in the array. If the name is found, the row containing that drawing will selected and the user will be prompted to update the hyperlink, then the "drawing date" will be moved to the right by one column, then the user will be prompted for another date replacing the date that was moved.

    The first sequence of commands or button works fine.

    The button "Revise Drawing" prompts the user with the inputbox requesting the revised drawing name, then develops the runtime error 1004. Any ideas would be very helpful.

    I have pasted the code and attached the workbook for your convenience.

    Thanks for any replies.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sgreni; 07-15-2009 at 04:13 PM. Reason: solved

  2. #2
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Comparing a string to values in an array resulting in a Run time Error 1004

    You're getting an error on :
    Please Login or Register  to view this content.
    I don't actually know what declaring something
    Please Login or Register  to view this content.
    means so I don't know what else to tell ya.

    Edit:
    Targetrow = 0 at the time of this error.
    You don't have it defined as anything so it's looking for A0.

    mew!
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  3. #3
    Registered User
    Join Date
    06-03-2009
    Location
    California
    MS-Off Ver
    Excel 2000
    Posts
    20

    Re: Comparing a string to values in an array resulting in a Run time Error 1004


    Thanks mewing kitty

    I think I have it figured out. I was calling the various subroutines in the wrong order and the variables weren't getting passed between subs correctly.

    If anyone has any thoughts on how to use more sophisticated methods, please comment. Thanks again.

    the working code should be:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Comparing a string to values in an array resulting in a Run time Error 1004

    One major step I'd look at is eliminating the .select from your code. for example:

    Please Login or Register  to view this content.
    Could be changed to:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1