Results 1 to 4 of 4

Thread: Need help with runtime error 6 overflow
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2019
    Posts
    138
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Need help with runtime error 6 overflow

    Hi Everyone,

    I am getting a runtime error(runtime error 6 overflow) when selecting ALL cells in a worksheet.
    This sheet has a pop up calendar referencing cell J3.
    Debug shows the error in the second line of the code below.

    Any idea why?

    Thank you!

    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)    If (Target.Count = 1) Then
        If Not Intersect(Target, Range("J3")) Is Nothing Then Calendar.Show
        End If
    End Sub

  2. #2
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,799
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Need help with runtime error 6 overflow

    Try changing it to:
    Code:
    If (Target.CountLarge = 1) Then
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  3. #3
    Board Regular
    Join Date
    Feb 2019
    Posts
    138
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Need help with runtime error 6 overflow

    Joe 4,

    That did the trick!

    Thank you!

  4. #4
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,799
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Need help with runtime error 6 overflow

    You are welcome.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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