Consulting

Results 1 to 3 of 3

Thread: Solved: Limit Entries

  1. #1

    Solved: Limit Entries

    I would like to limit the number of entries made in a spreadsheet to 10000 rows. If I select any cell in row 10000, i would have a msgbox display and run a seperate code base on the msgbox answer. Creating the msgbox is not a problem, but can someone assist me into writing the part of the code that when I select any cell in row 10000 it will open display the msgbox?

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Put this in the worksheet code module[VBA]Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Nxt:
    If Target.Row > 9999 Then
    msg = MsgBox("Do you want to go to A1?", vbYesNo, "Row Limit Reached")
    If msg = vbYes Then
    Me.Range("A1").Select
    ElseIf msg = vbNo Then
    MsgBox "You can't stay here all day!"
    GoTo Nxt
    End If
    End If
    End Sub[/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Thank you Simon. BTW, very interesting msgboxs

Posting Permissions

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