rhombus4
Well-known Member
- Joined
- May 26, 2010
- Messages
- 586
- Office Version
- 365
- 2016
- Platform
- Windows
On a Userform when I change a combobox, the value gets entered into a cell
This then runs an Advanced Filter, However I keep getting an error 'unable to get the currentregion property of the range class' when it tries to run the Filter
I know the filter works because it runs fine if I run it manually
But when I try and Run it from Combobox1_Change I get the error
I also get the Same error if I try Debug.Print sheet3.Range("A1").CurrentRegion.Address
This then runs an Advanced Filter, However I keep getting an error 'unable to get the currentregion property of the range class' when it tries to run the Filter
I know the filter works because it runs fine if I run it manually
VBA Code:
Sub filter_Test()
Sheet3.Range("A1").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheet2.Range("T1:T2"), _
CopyToRange:=Sheet2.Range("H6")
End Sub
I also get the Same error if I try Debug.Print sheet3.Range("A1").CurrentRegion.Address
VBA Code:
Private Sub combobox1_Change()
Sheet3.Range("A1").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheet2.Range("T1:T2"), _
CopyToRange:=Sheet2.Range("H6")