Filtering to a specific row and then selecting a specific visible cell using VBA

lakshman

New Member
Joined
May 22, 2017
Messages
14
Hi all,

I have data about the equity products we release everyday. First, I want to filter for producers in my team under "Product Requestors" in Column P:

Code:
ActiveSheet.Range("$A$1:$AM$77").AutoFilter Field:=36, Criteria1:=Array( _
        "John", "Jane", "Jack"), Operator:=xlFilterValuesv

Then, I want to filter for a particular stock ticker from Column N:

Code:
ActiveSheet.Range("$A$1:$AM$77").AutoFilter Field:=14, Criteria1:="CAPL SP"

This will typically leave only one row. Within the one row, I want to select the cell that has the product's Minimum Notional Value. This falls under Column H.

Each time I do a different filter, the selected cell would naturally be different. I want this so that I can eventually use my Macro (I've already created this for another task, thanks to the wonderful MrExcel community) to copy paste this value into another sheet.

I would really appreciate it if anyone can help me out on this!
 
Hey. That doesn't work. It says Paste Range Class failed. I looked up online and I read that you cannot mix PasteSpecial with Copy Destination but I'm not sure of how to not mix them and get the result I want.
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
laksham I got it to work by separating into 2 lines of code.

Code:
copyRange.SpecialCells(xlCellTypeVisible).Copy 
pdttype.Range("C11").PasteSpecial(xlPasteValues)
</pre>
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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