Insert Cell Value to VBA Formula

Murphthaaggie21

New Member
Joined
Jun 3, 2015
Messages
1
Sorry i'm sure this is simple, but I can't figure it out.

I have a macro that part of it filters down a pivot table to a value of lets just say $150.00

Looks a little something like this:

ActiveSheet.Range("$A$5:$D$75000").AutoFilter Field:=4, Criteria1:=">150", _
Operator:=xlAnd

However i would like to make that value be adjustable to be what I currently have in Cell lets say D7 on Sheet 1 a different sheet.

How do i do this?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi Murphthaaggie21,

Welcome to MrExcel!!

See if this is what you need:

Code:
ActiveSheet.Range("$A$5:$D$75000").AutoFilter Field:=4, Criteria1:=">" & Sheets("Sheet1").Range("D7"), Operator:=xlAnd

Regards,

Robert
 
Upvote 0
Sorry i'm sure this is simple, but I can't figure it out.

I have a macro that part of it filters down a pivot table to a value of lets just say $150.00

Looks a little something like this:

ActiveSheet.Range("$A$5:$D$75000").AutoFilter Field:=4, Criteria1:=">150", _
Operator:=xlAnd

However i would like to make that value be adjustable to be what I currently have in Cell lets say D7 on Sheet 1 a different sheet.

How do i do this?


Hi there :)


Try

Code:
ActiveSheet.Range("$A$5:$D$75000").AutoFilter Field:=4, Criteria1:=">" & Range("D7").Value, _
Operator:=xlAnd
 
Upvote 0

Forum statistics

Threads
1,203,099
Messages
6,053,523
Members
444,669
Latest member
Renarian

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