Macro not calculating correctly

theebookzoo

New Member
Joined
Aug 12, 2008
Messages
16
I have two tabs in my worksheet Dashboard and Details.. in the Dashboard I have rows that look like:
AMC 78
ANG 152

These are all links to the Details tab. So if you click on say 78, it takes you to the Details tab and filters on the col1 (ie. AMC), and gives you all AMC items....

What should happen is that the TOTAL (ie. 78 or 152) in the SUmmary should correspond to the DETAIL tab (ie. 78 lines of AMC data, or 152 lines of ANG data)...

Need more info let me know... I gotta get this thing out....

My Code looks like the below:


Rich (BB code):
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Rich (BB code):
' follow the target link
Application.EnableEvents = False ' stop recursive call
Target.Follow
Application.EnableEvents = True
 
' Get the row index
Dim rowNum As Integer
rowNum = ActiveCell.Row 'Target.Parent.Row
 
' Get the clicked column
Dim columnNumber As Integer
columnNumber = ActiveCell.Column ' Target.Parent.Column
 
' get the name of the organization.
Dim orgName As String
orgName = Cells(rowNum, 1)
 
' Filter on the org
Sheet23.Range("A1:O1").AutoFilter
Sheet23.Range("A1:O1").AutoFilter Field:=1, Criteria1:=orgName
 
' now we need to figure out the column stuff
If columnNumber = 3 Then
' Z1 is missing
Sheet23.Range("A1:O1").AutoFilter Field:=10, Criteria1:="X"
ElseIf columnNumber = 5 Then
' p7 PM is missing
'Sheet23.Range("A1:K1").AutoFilter Field:=12, Criteria1:="X"
ElseIf columnNumber = 6 Then
' p7 POC missing
Sheet23.Range("A1:O1").AutoFilter Field:=11, Criteria1:="X"
ElseIf columnNumber = 7 Then
' P34 missing
'Sheet23.Range("A1:O1").AutoFilter Field:=13, Criteria1:="X"
ElseIf columnNumber = 8 Then
' G13 missing
Sheet23.Range("A1:O1").AutoFilter Field:=12, Criteria1:="X"
ElseIf columnNumber = 9 Then
' MS missing
Sheet23.Range("A1:O1").AutoFilter Field:=13, Criteria1:="X"
ElseIf columnNumber = 13 Then
' S42 missing
Sheet23.Range("A1:O1").AutoFilter Field:=14, Criteria1:="X"
ElseIf columnNumber = 14 Then
' A7 missing
Sheet23.Range("A1:O1").AutoFilter Field:=15, Criteria1:="X"
End If
End Sub
<!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig --><!-- edit note -->
 
Last edited by a moderator:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,224,585
Messages
6,179,706
Members
452,939
Latest member
WCrawford

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