Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8343309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:01:09+00:00 2026-06-09T06:01:09+00:00

I am trying to send the user to a certian sheet in the workbook

  • 0

I am trying to send the user to a certian sheet in the workbook based on the value of the hyperlink they click on. “1.01” Is example text in one of the cells that are hyperlinks. I have the event getting triggered when they click with this code, but every time the BR is 0.

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    Dim BR As Integer
    BR = ActiveCell.Value
    Select Case BR
    Case Is < 2  'case always gets run because BR is always 0
        Worksheets("Appts").Select
    Case 2 To 3
        Worksheets("Next").Select
    Case 3 To 4
        Worksheets("Calls").Select
    End Select
End Sub

I think my problem is where I am getting the ActiveCell.Value but I haven’t been able to figure it out. Any help is appreciated.

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:01:11+00:00Added an answer on June 9, 2026 at 6:01 am

    Is this what you are trying?

    Activecell will always give you the value of the cell that is active. If you want the value of the cell which has the hyperlink then use this.

    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim BR As Integer
    
        BR = Target.Range.Value
    
        Select Case BR
            Case Is < 2: Worksheets("Appts").Select
            Case 2 To 3: Worksheets("Next").Select
            Case 3 To 4: Worksheets("Calls").Select
        End Select
    End Sub
    

    EDIT

    Since there is lot of comment around using the correct data type. Here is an added info. From your select case it is evident that you are only concerned with values from 1 to 4. In such a case declaring your variable as Integer is just fine. If you are not sure of the user input then introduce a small error handling because then declaring the variable as Integer or Long or Single wouldn’t help. For example

    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
        Dim BR As Integer
    
        On Error GoTo Whoa
    
        BR = Target.Range.Value
    
        Select Case BR
            Case Is < 2: Worksheets("Appts").Select
            Case 2 To 3: Worksheets("Next").Select
            Case 3 To 4: Worksheets("Calls").Select
        End Select
    
        Exit Sub
    Whoa:
        MsgBox "The value of the cell which has the hyperlink doesn't fall in the range 1 to 4"
    End Sub
    

    SNAPSHOT

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send a new user name to add to one of
I am trying to send user to previous page history.go(-1). This works fine in
I`m trying to send simple html page with form data to user with GET,
I am trying to make a simple application which will send the user to
I am trying to create a login page that will send the user to
I am trying to implement an own OpenID endpoint based on SMF user accounts.
I am trying to send a AJAX request to the server when a user
I am trying to send the user to either google or yahoo depending on
Am trying to send a mail to recipient from iPhone app without user's interaction.
I'm trying to send user credentials via sms after registration.The gateway can be accessed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.