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 8067913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:29:18+00:00 2026-06-05T12:29:18+00:00

Hoping someone can help with a VBA problem I am having. I want to

  • 0

Hoping someone can help with a VBA problem I am having.

I want to change the value for a Named Range when a user double clicks on the cell. There are two worksheets, the initial worksheet with a value in a cell and then the destination worksheet which contains the Named Range Account_Number.

This is my code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

    [Account_Number] = ActiveCell.Value 'assign the value to the Named Range

    Range([Account_Number]).Select ' go to the Named Range on the other worksheet

   'Sheets("Transaction Listing_LINKS").Select 'the workaround to the problem below
End Sub

What I expect is that the Named Range to be populated and selected.

The problem is I get a

“1004 error: Method ‘Range’ of object ‘_Worksheet’ failed”

error when I double click on the cell.

The strange thing is that if I only use one worksheet it works without any problems.

Can anyone explain to me why this would happen and how to avoid it?

The only fix/workaround I can think of is to code the selection of the worksheet to force it to select it.

Thank you

  • 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-05T12:29:20+00:00Added an answer on June 5, 2026 at 12:29 pm

    Try:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
      'assign the value to the Named Range
      Sheet2.Range("Account_Number").Value = ActiveCell.Value
      ' go to the Named Range on the other worksheet
      Application.GoTo Reference:="Account_Number" 
     'Sheets("Transaction Listing_LINKS").Select 'the workaround to the problem below
    End Sub
    

    Of course you’d need to change “Sheet2” to the destination worksheet name containing the named range.

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

Sidebar

Related Questions

I'm hoping someone can help me with this annoying little problem I'm having. I'm
Im hoping someone can help me out with a problem Im having with using
I am hoping someone can help me with a css problem... I am using
I'm hoping someone can help me as I've been stuck on this problem for
Hi I'm hoping someone can help me out with a jQuery lavalamp problem. I
I'm hoping someone can help me see the real value in these tests because
Im hoping someone can help me with a brain block I'm having about how
I'm hoping someone can help with this, I'm having a really difficult time getting
Im hoping someone can help me with a small problem! I have a php
I hoping someone can help me with a problem I'm stuck(again) with. if i

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.