+ Reply to Thread
Results 1 to 1 of 1

Macro not calculating correctly

Hybrid View

theebookzoo Macro not calculating... 05-24-2011, 11:30 AM
  1. #1
    Registered User
    Join Date
    08-12-2008
    Location
    Ohio
    Posts
    11

    Macro not calculating correctly

    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:

    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
            ' 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
    Last edited by theebookzoo; 05-24-2011 at 01:08 PM. Reason: forgot [code] arount the code

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1