+ Reply to Thread
Results 1 to 7 of 7

Two identical codes produce different results

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    811

    Two identical codes produce different results

    I have two identical (?) pieces of code on two different sheets (Rigs and Contractors). One is in modules, and the other in the view code on the sheet. One runs, one doesn't. I appear to have an undeclared variable but I can't see where.
    Attached Files Attached Files
    Last edited by BRISBANEBOB; 02-15-2014 at 09:19 PM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Two identical codes produce different results

    Hi BRISBANEBOB,

    The solution to your problem is that you can't find the value "Rig" in the Header line. In this case, change the cell E8 in the sheet Rigs to "Rig" or edit the code

    Cheers, berlan
    Last edited by berlan; 02-15-2014 at 07:33 PM.

  3. #3
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    811

    Re: Two identical codes produce different results

    Hi Berlan

    i have obvisouly messed up the fix. I have tried to run this from both the module and the tab but the eerror message -, Object Variable or With block variable not set'


    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Two identical codes produce different results

    Try if the attached works for you

    Change the E8 value to "Rig" and the code to:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    811

    Re: Two identical codes produce different results

    I have now succeeded in getting both pieces of code to fail! The Rigs and the Contractors won't run the sort. New sample attached
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Two identical codes produce different results

    Okay, try if the attached works. Made the NewCode module more general as an alternative to use for both sheets:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    811

    Re: Two identical codes produce different results

    Thanks for that berlan - works beatuifully! Reputation added.

+ 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. Calculation problem to produce 3 different results from IF
    By mgxeab in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2013, 04:11 AM
  2. Produce multiple results after searching a value
    By Stagnant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2013, 06:55 AM
  3. [SOLVED] MIN for different columns of same values produce different results
    By bobboy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-29-2013, 11:11 PM
  4. Produce data from two corrosponding Cells but displays only certain codes
    By Chrissy1818 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-22-2012, 12:17 AM
  5. IF statement does not produce required results
    By nhandal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2009, 12:49 PM

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