Question : Range Reference

Hi,

Please look at the below code first.
I am not having any clue to change this portion
Set rngCrt = Range("E2")

It is taking reference from the active sheet, however what I want is to make it take reference from Sheet1.

I tried Sheet1.range("E9").value; but this is not working.

I need to declare the value into a specific cell of Sheet1 (E9).

Please help.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Dim rngData As Range
Dim rngFlt As Range
Dim rngCrt As Range
 
    Set rngData = Range("A1").CurrentRegion
    Set rngFlt = Range("G1")
    Set rngCrt = Range("E2")
    
    rngFlt = rngData(1, 1)
    
    rngFlt.Offset(1) = "=""*""& " & rngCrt.Address & " & ""*"""
    
    rngData.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=rngFlt.Resize(2), CopyToRange:=Range("J1"), Unique:=True
Open in New Window Select All

Answer : Range Reference

Hi,

It is working fine for me, somehow I'd missed your test file.
 
Test.xls
 
Random Solutions  
 
programming4us programming4us