Consulting

Results 1 to 19 of 19

Thread: Solved: Need a msgbox to report to me the missing record number

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,874
    Location
    Quote Originally Posted by Simon Lloyd
    Thats fair enough but he'd need to use the find all function to find the 2's in 18000 rows
    I do know though for sure that I have a record number missing and I know that a user almost certainly must have deleted a row,

    I read the OP's #1 as only one record was missing, and was looking for a quick and dirty way to find it

    From the more involved macros, maybe I misunderstood

    Paul

  2. #2
    VBAX Expert
    Joined
    Sep 2010
    Posts
    604
    Location
    HI Simon,

    After taking a nap, I'm seeing a few less double images with my blurry eyes now, and my head is pounding a lot less, so I'm fairly sure now that I am correct this time in saying that you have tackled the challenge nicely.

    Thank you Sir
    ---------------------------------------------------
    Paul,

    You are correct. Originally there was only one number missing, and I used a method similar to yours to spot it. - What has transpire since then, has been mostly for interest sake, but also so that I'll have it just incase the situation arises again.

    mancubus

    Yours is giving me a runtime error 5, invalid procedure call, or arguement on this line:
    temp = Left(temp, Len(temp) - 2)

    Thank you much for your time


  3. #3
    VBAX Expert shrivallabha's Avatar
    Joined
    Jan 2010
    Location
    Mumbai
    Posts
    744
    Location
    Here's a revised version of Paul's idea. This code marks "ERR" in column B where a value is missed.
    [VBA]Sub PaulsIdea()
    Application.ScreenUpdating = False
    With Range("B3:B" & Range("A" & Rows.Count).End(xlUp).Row)
    .FormulaR1C1 = "=IF(R[-1]C[-1] - 1<>RC[-1]," & Chr(34) & "ERR" & _
    Chr(34) & "," & Chr(34) & Chr(34) & ")"
    .Value = .Value
    End With
    Application.ScreenUpdating = True
    End Sub[/VBA]
    Regards,
    --------------------------------------------------------------------------------------------------------
    Shrivallabha
    --------------------------------------------------------------------------------------------------------
    Using Excel 2016 in Home / 2010 in Office
    --------------------------------------------------------------------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •