Clicking on Cell on one sheet and seeing the details on another sheet

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have set up management accounts on sheet "Man_ACCTS". I have an account called general expenses in Col A and the total value in Col B.

I have the breakdown of all the general expenses on sheet TB and have named these "Gen_Expenses"

I would like the user to be able to double click on General expenses on sheet "Man_ACCNTS" and to be able to see what makes up this account on sheet TB

Your assistance in guiding me in the right direction is most appreciated.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Maybe something along these lines, just an idea
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("Man_ACCNTS")) Is Nothing Then
        Range("Gen_Expenses").Select
    End If
End Sub
 
Upvote 0
Thanks for the help. I get a run time error 1004 "Method range Object_Worksheet failed which I double click on General Expenses on sheet "Man_ACCNTS"

The general expenses on sheet TB has been named and refers to Col A =TB!$C$95:$C$101

It would be appreciated if you would assist in rectifying this error
 
Upvote 0
Does this work?

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("Man_ACCNTS")) Is Nothing Then
        TB.Activate
        TB.Range("Gen_Expenses").Select
    End If
End Sub
 
Upvote 0
Thanks for the reply.

For some unknown reason this is not working. It still get a run time error

I have changed my sheet name to Income_Statement

On sheet "Income_Statement" I have general expenses in Col A


Excel 2012
AB
23General Expenses1565
Income_Statement


On sheet "TB" I have named General Expenses GEN_EXPENSES"

Excel 2012
C
96General Expenses - Renovations
97General Expenses - Replacement
98General Expenses - Flat
99General Expenses - Groceries/Photo's etc
100General Expenses - Hygiene/Pest Control
101General Expense - Relocation Exp
TB
 
Upvote 0
So cell A23 is the range(Cell) named "Man_ACCTS"? I noticed i called the range ACCNTS rather than ACCTS.

On the Income_Statement sheet, right click>View code and paste the modified code in there

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("Man_ACCTS")) Is Nothing Then
        TB.Activate
        TB.Range("Gen_Expenses").Select
    End If
End Sub
 
Upvote 0
Thanks for the reply and your amended code

I have right clicked on the On the Income_Statement sheet and pasted the modified code in there

After double clicking on cell A23, I now get runtime error 424 Object required and the following code is highlighted

Code:
 TB.Activate
 
Upvote 0
That last code assumes that the sheet that has the range("gen_Expenses") is a sheet called TB. Isn't that the case? If it isn't, change the name of the sheet to the appropriate name

I have run this exact code and it works fine for me

Victor
 
Upvote 0
Thanks for the reply. The ranged named "Gen_Expense" is on sheet TB

For some unknown reason when I click on sheet1 general Expenses" it comes runtime error 424 Object required and TB.activate is highlighted
 
Upvote 0
Thanks for the reply. The ranged named "Gen_Expense" is on sheet TB

For some unknown reason when I click on sheet1 general Expenses" it comes runtime error 424 Object required and TB.activate is highlighted

Click or double click?

The cell you click on i named "Man_ACCTS"? Is that right?

This should work
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)


    If Not Intersect(Target, Range("Man_ACCTS")) Is Nothing Then
        Sheets("TB").Activate
        Sheets("TB").Range("Gen_Expenses").Select
    End If
End Sub

Maybe i had been assuming too much :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top