+ Reply to Thread
Results 1 to 11 of 11

Error 91 - I'm missing something

  1. #1
    Registered User
    Join Date
    09-16-2013
    Location
    Kansas, U.S.
    MS-Off Ver
    Excel 2007
    Posts
    17

    Error 91 - I'm missing something

    I'm new to Macro's but very experienced with Excel .

    I wrote the following macro to look down column "V", find a text character "X".
    Copy and "paste special value" the "X" and the two columns to the right of the "X".
    Then, come back, erase the "X" and move the "X" one row below it's last location.

    Then, the macro moves to column "R" to find and erase an "X" in that column.

    The "error 91" occurs while trying to find the "X" in column "R".


    I'm sure I've left some "definition" out but I need some help.

    Thanks,
    toolman_dustin




    Please Login or Register  to view this content.
    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 09-17-2013 at 10:39 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error 91 - I'm missing something

    If the X has just been cleared how is Find going to, well, find it?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-16-2013
    Location
    Kansas, U.S.
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Error 91 - I'm missing something

    The first "X" deleted was in column "V".

    The error is occurring while trying to delete an "X" in column "R".

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error 91 - I'm missing something

    You aren't specifying where to search, just using Selection.

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Registered User
    Join Date
    09-16-2013
    Location
    Kansas, U.S.
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Error 91 - I'm missing something

    The attached example should help. thanks
    Attached Files Attached Files

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error 91 - I'm missing something

    When I copy the posted code into the workbook you attached and then run it the error is right at the start, here.
    Please Login or Register  to view this content.
    When I look at column V there's no data, all the data seems to be within column B to I and K to R.

  7. #7
    Registered User
    Join Date
    09-16-2013
    Location
    Kansas, U.S.
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Error 91 - I'm missing something

    Here is a slice of the actual spreadsheet.

    The macro will function. It performs correctly the first time you run it, It fails the second time you run it.

    thanks, Dustin
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-16-2013
    Location
    Kansas, U.S.
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Error 91 - I'm missing something

    I found the error. Thanks to your request for a working example.

    The search in column "R" was supposed to run from row 34 to row 119.

    I was placing an "X" in column R beyond row 60 (which is how it is coded). So the error occurred when the search for "X" failed.

    Thanks for taking the time to help.

    Dustin

  9. #9
    Registered User
    Join Date
    09-16-2013
    Location
    Kansas, U.S.
    MS-Off Ver
    Excel 2007
    Posts
    17

    <solved> Re: Error 91 - I'm missing something

    we got this solved. thanks

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error 91 - I'm missing something

    Dustin

    Glad you solved it.

    Remember and mark the thread solved - there's a button for doing that apparently, not sure where though.

  11. #11
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Error 91 - I'm missing something

    I think it might be in the 'thread tools' link at the top of the thread
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 02-25-2012, 10:54 PM
  2. missing operator error
    By Jollyfrog in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-28-2010, 09:13 AM
  3. Missing references VBA fix (to avoid compile error)?
    By fantata1 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-04-2009, 10:44 AM
  4. XP VBA Compile error...Missing files
    By Stu78 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2005, 02:35 PM
  5. Replies: 2
    Last Post: 08-01-2005, 09:39 AM

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