Results 1 to 12 of 12

SOLVED: Same code in two different sheets, yet 1004 error in one

Threaded View

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    SOLVED: Same code in two different sheets, yet 1004 error in one

    Hi everyone,

    I'm rather new to VBA, but I have managed to set up two userforms in two spreadsheets. The code for some of the functions is identical, for instance:

    -checking whether a branch name already exists in the spreadsheet (BNCheckButton_Click())
    -updating an existing record (UpdateExistingButton_Click())
    -saving a new record and exiting the form (OKCloseButton_Click())
    -saving a new record and starting a new record (OKNextButton_Click())
    -clearing the form (ClearForm())
    -saving the form (SaveForm())
    -filling the form (FillForm())

    The problem is, that the code works in one spreadsheet (FranchisingTest) but not the other (LeasingTest 2). I can't for the life of me work out what the difference is, and why it won't work in the second sheet.

    Essentially, when I open FranchisingTest, I can do all of the base things I need to do: search for an existing record, update it, create a new one, etc. But when I try to do the same thing in LeasingTest 2, I keep getting 'Run-time error: '1004': Application-defined or object-defined error', and it's generally pointing at one of these lines:

    C.Value = Intersect(LastFind.EntireRow, LastFind.Parent.Columns(C.Tag))
    (in FillForm())
    or
    Intersect(LastFind.EntireRow, LastFind.Parent.Columns(C.Tag)) = C.Value
    (in SaveForm())

    I've attached both spreadsheets. Can anyone help me figure out what's going on? I'm tearing my hair out!!

    Thanks so much!
    FranchisingTest.xls
    LeasingTest 2.xls
    Last edited by caracolesa; 10-07-2012 at 08:58 AM. Reason: added code tags

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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