Filter as a resize of an offset of a variable?

Lidget

New Member
Joined
Apr 14, 2021
Messages
8
Office Version
  1. 2013
Platform
  1. Windows
Hi,
I have a list of worksheet names in column c corresponding to other information on that row, columns I:Y correspond to some data I want to filter for but I'm struggling. From a log of googling, offset and resize seems to be the way forward but I can't get it going.
Currently working with
Rich (BB code):
Dim c1 as range
Dim rngwork as range
Dim vwork as variant

With sheets("control")
For each c1 in .range("c4"),  .range("c" & rows.count).end(xlup))
If evaluate("isref('" & c1.value & "'!a1)") then
Set rngwork = worksheets("control").range(c1.offset(0,6).resize(0,17))
vwork = rngwork.value
Sheets("data").range("a4:az").select
Selection.autofilter field:=4, criteria1:=array(vwork), operator:=xlfiltervalues
'some copy and paste here
Next c1
End with

Can anyone help me stop banging my head on the desk please, it's getting sore
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Lidget

New Member
Joined
Apr 14, 2021
Messages
8
Office Version
  1. 2013
Platform
  1. Windows
Ignore me, sorted it through a lot of trial and error.
Should have been
Set rngwork = c1.offset(,6).resize(,17)
 
Solution

Forum statistics

Threads
1,141,069
Messages
5,704,111
Members
421,327
Latest member
Msh

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
Top