ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do you create drill-down detail? (https://www.excelbanter.com/excel-programming/372891-how-do-you-create-drill-down-detail.html)

Sandroid

how do you create drill-down detail?
 
I have a summary sheet and what to click on cell and see detail from another
sheet. Can this be done?

Jim Thomlinson

how do you create drill-down detail?
 
Yes that can be done but it is a bit of work... In general here is what you
want to do. Add named ranges to your Summary sheet. We are going to check if
the user double clicks anywhere withing the named range. Then based on what
named range they double click on will dictate what sheet they will be
navigated too. Here is some sample code for you . It does not use named
ranges but I do highly recommend you use named ranges as they will make the
code easier to read and it will make things easier to modify if your summary
sheet changes... This code works on a new book. Place this code into Sheet1
(right click on the tab and select view code. paste the following. If you
double click in either B1:Z5 or B6:Z10 you will be navigated to one of the
other sheets...

Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
With Sheets("Sheet1")
If Not Intersect(Target, .Range("B1:Z5")) Is Nothing Then
Cancel = True
Sheets("Sheet2").Select
ElseIf Not Intersect(Target, .Range("B6:Z10")) Is Nothing Then
Cancel = True
Sheets("Sheet3").Select
End If
End With
End Sub

--
HTH...

Jim Thomlinson


"Sandroid" wrote:

I have a summary sheet and what to click on cell and see detail from another
sheet. Can this be done?



All times are GMT +1. The time now is 11:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com