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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:37:15+00:00 2026-05-12T08:37:15+00:00

The following VBA code sits in a worksheet called SCU and the cell C4

  • 0

The following VBA code sits in a worksheet called “SCU” and the cell “C4” is the information I would like to filter on.
When double clicking on “C4” this takes us through to the “Account Data” sheet and attempts to filter on the active cell, however as it’s on a separate worksheet I get the wrong data in the filter (Not “C4” in “SCU) I was wondering if there is a way to ref the “SCU” worksheet?

Private Sub Worksheet_BeforeDoubleClick (ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range("C4")) Is Nothing Then
Else
    Sheets("Account Data").Select
    Selection.AutoFilter Field:=1, Criteria1:=ActiveCell
End With
End If
End Sub

Hope you can help!
Mike Foster

  • 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-05-12T08:37:15+00:00Added an answer on May 12, 2026 at 8:37 am

    When you select the sheet, the ActiveCell changes.

    Try

    Criteria1:=Intersect(Target, Sheets("SCU").Range("C4"))
    

    or alternatively use

    Criteria1:=Sheets("SCU").Range("C4")
    

    If this doesn’t work because the filter cell is dynamic, then give more details so we can come up with a better solution.

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

Sidebar

Related Questions

I tried putting the following code into a program yesterday. VBA called an error.
I am trying to put the following code into VBA. What I ideally want
Win-XP / Excel 2003 / VBA .... I have the following piece of code
I am using the following VBA code to export PPT slides to images. The
What does !escape do in the following line of VBA code? There isn't a
The following line in my VBA code is generating the compile error 'Compiler error
I have the following in a piece of VBA code: For i = 1
I have some VBA code in an Excel workbook. I have a cell which
I have the following vba-code in an MS-Access97-frontend which opens a word-document stored on
I have the following VBA code: mainFile = ActiveWorkbook.Name 'select all excel files in

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.