+ Reply to Thread
Results 1 to 7 of 7

Problem with Amend Macro

  1. #1
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Problem with Amend Macro

    I'm sorry to be asking what I'm sure are beginner's questions, but I do appreciate all the help.

    I am having trouble with a user form. It is linked to a spreadsheet titled "Employee_Info_Page". When I run the amend macro, I'm using this code

    Please Login or Register  to view this content.
    The problem is early on at "If Rng Is Nothing Then GoTo skip." When it gets here, it says "Object expected," and I have no idea what to put in there.

    Any help you can give on this is appreciated, and of course if you see any other obvious problems in their, I'd love it if you could point them out.

    Thanks!
    Last edited by just_some_guy; 03-03-2010 at 02:09 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Problem with Amend Macro

    Hi

    Where / how is rng defined? I'm presuming that it is a range of some sort, but where does the definition for it happen?

    rylo

  3. #3
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Problem with Amend Macro

    I had thought that the range was defined in my "find" macro. That fills my form, and then I'm trying to amend from that.

    Should I use the same range I'm using in that?

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Problem with Amend Macro

    Hi

    Is it a global variable, or is it local to the find macro?

    Maybe attach an example sheet with some dummy data, but include all the relevant forms and macros.

    rylo

  5. #5
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Problem with Amend Macro

    I'm honestly not sure which it is. I would think it was local, because I've never heard of global. I'm still really new to VBA, if it wasn't painfully obvious.

    Here is the attachment. When I pull up the macro list, the items aren't listed there, but if I go into Visual Basic, it shows up there.

    Thanks for your help and patience.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Problem with Amend Macro

    Hi

    If it was local it wouldn't be available to the other macro. Have a look at the various items in help about the scope of variables and it may make more sense to you.

    Add a general module to the workbook, and in the top row enter
    Please Login or Register  to view this content.
    Then try running the code and see what happens. I don't have time to test it at the moment, but will get to it when I can if that doesn't resolve things.

    rylo

  7. #7
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Problem with Amend Macro

    Rylo,

    That fixed the problem. My whole form is actually working the way it's supposed to! This is me being thrilled!

    Thanks a ton for your help, and of course for your patience!

+ 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