Filter VBA Offset function

p4nny

Board Regular
Joined
Jan 13, 2015
Messages
246
Hello

I currently have the code however I would like to change it slightly.

The line with '''''

Rather than the code perform this action "testCell.Offset(, 1).Value = "Key in the dependency ID"

I would like it to filter another tab called "dependencies" (column A) by using the value in the original tab (Offset(, -2)

Then stop the code on the "dependencies" tab.

So when testCell.Value = "Y" Then filter "dependencies" tab for the value in (Offset(, -2)

Hope that makes sense.




Code:
Private Sub Worksheet_Change(ByVal Target As Range)


Dim testRange As Range


Set testRange = Application.Intersect(Target, Range("C:C"))


If Not testRange Is Nothing Then
    Application.EnableEvents = False
    For Each testCell In testRange
        If testCell.Value = "Y" Then
            ''''''testCell.Offset(, 1).Value = "Key in the dependency ID"
        Else
            testCell.Offset(, 1).Value = "N/A"
        End If
    Next testCell
    Application.EnableEvents = True
End If


End Sub
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,216,118
Messages
6,128,939
Members
449,480
Latest member
yesitisasport

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