+ Reply to Thread
Results 1 to 10 of 10

Identify missing numbers

  1. #1
    Registered User
    Join Date
    04-16-2004
    Posts
    32

    Question missing numbers...

    Hi there,

    this is exactly what i am looking for also, can you please explain how i can use that code in 2007? I have attached a list of the numbers i'm working with, please can you have a look for me?

    I've tried entering it ion visual basic but i keep getting:

    COMPILE ERROR

    INVALID OUTSIDE PROCEDURE

    Any help would be much appreciated...

    thank you

    Regards

    swm
    Attached Files Attached Files
    Last edited by swmasson; 05-26-2008 at 10:39 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, I wrote this some time ago,so I've just copied it back from this thread inserted it into a CommanButton, placed a series of sequential numbers in column "A" with some numbers missing , and run the code and it works fine I can not replicate your problem and unfortunately I'm running excel 2003 and have no experiance of 2007. I should have another go, I don't know why there should be any problems the code is quite straight forward.
    Perhaps you could ask the question in another thread !
    Good luck
    Mick
    PS I've just looked at your attached file, (should have done that in the first place) and tried to use you numbers, there is a problem, the code runs alright but there are some peculiar results I'll have another look and try to post you back
    Mick
    Last edited by MickG; 05-26-2008 at 11:08 AM.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, I've altered the code because it didn't like your large numbers.
    The missing numbers are now placed in column offsets from column "A"
    I have run it with you numbers and it works except you have, in one place 800 numbers missing which rather exceeds the columns available, but with 2007 I think you have got a few more to play with.
    Have a go with this, see how you get on.
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Registered User
    Join Date
    04-16-2004
    Posts
    32

    Red face

    thanks for that, much appreciated... however, i cant seem to figure out how to use the code, whenever i paste it into visual basic and select run, it asks me to create a macro... i choose a name and select create... it comes up with an error message saying:

    INVALID PROCEDURE NAME?

    Can you please help?

    Thank you

    Regards

    SWM

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, Try a Command Button
    ----------
    Inserting a Command Button in worksheet and Allocating Code

    Open your workbook at the Sheet Number with your Data that you want to Manipulate.
    Click View, Tools, Control Box,---- Control Box Menu Appears on sheet.
    Slide you cursor over the Tool Box until you find a Command Button.
    Click It then click Somewhere on the sheet.-- Command Button appears on sheet.
    The Command Button will have handles round its edge, This is so you can Position it on the sheet.
    Click the command Button "Hold the Mouse Click Down" and Drag the Command Button to where you want it.
    Double Click the Command Button, The VB Editor window will appear.
    You can also open the Editor By clicking Alt + F11, but if you double click the Command Button the editor will open in the procedure relating specifically to your Command Button.
    If the VB Editor window has two panes the right pane is where you must paste your code.
    The left pane can be "Project Window" or "Properties Window, Click "Ctrl+R" if not showing.
    Paste your code just under the words "Private Sub CommandButton1_Click() " in the Right hand pane.
    If you have done this correctly. Scroll to the bottom of the code and you should see the words "End Sub"
    On the VB Toolbar you will see a Green Triangular shapes icon,.
    This is to change the VB Editor mode from "Run Mode" to "Design Mode "
    Click this Icon, The Small blue square to its left will change from light blue to dark blue, or Vice Versa. Before you close the Editor make sure this Square is "Dark Blue" i.e. (Reset)
    Sometimes the it will appear Reset when it is not, that why I usually put a message at the bottom of the code, to know if is run or not.
    Close the Editor. Select the Command Button and Click it.
    When the code Runs the Msgbox should appear With The Message "Transfer Complete" ,if this doesn't happen Open The VB Editor "Alt + F11" and click the "Reset ( Blue Square) and or The "Green Triangle" on the Tool bar . The Blue Square should be "Dark Blue ", in order to run the code..
    NB:- If you want to get back into this specific code through the Command Button.
    Get the Control Box menu back on the screen, Click the green triangle, When you slide the cursor over your Command button , The cursor shape will change to a "Arrow Headed Cross" , you will then be able to double click it to view your code.
    If you prefer, you can forgo all this hassle by putting the code in an MT macro, with a key combination like (Ctrl+"A") to run it.
    If you still get a problem , call back
    Regards Mick

  6. #6
    Registered User
    Join Date
    04-16-2004
    Posts
    32

    Question it worked!

    Awesome, thanks for that... it worked first time!

    Do you know how i can pull all that data into one column or will i have to do it individually... eek!

    Thanks again for all your help!

    Regards

    SWM

  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, Do you mean all the missing numbers, if so where would you like to put them, considering in one case there were 800 of them.???
    Regards Mick

  8. #8
    Registered User
    Join Date
    04-16-2004
    Posts
    32
    I would like to place them in the next sheet i.e. sheet 2 and all in column 'A'.


    once i have dont this, i will add them all to the original numbers, sort them and run the script again to find the remaining missing numbers...

    Thanks

    steve

  9. #9
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi Steve,
    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  10. #10
    Registered User
    Join Date
    04-16-2004
    Posts
    32

    Thumbs up

    Genius... total genius...

    Thanks a lot!

    Regards

    swm

+ 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