We have two worksheets:
- Reference
- Operator
Suppose the cell d2 in the Reference sheet contains the value $a$25 .
How to change the value of the cell $a$25 in the Operator sheet using Excel VBA (referencing the address from d2 in the Reference sheet)?
What I have tried:
- Capturing the reference in d2 with a variable:
Dim NewRNG as Range
NewRNG = Range(Range("d2").value).value
No luck here.
- Finding the reference cell in Operator and using the found cell's address
Sub Find_Cell()
Dim RNG As Range
Dim NewRNG as Range
With Sheets("Operator").Range("A:A")
Set RNG = .Find(What:=Sheets("Reference").Range("d2"), _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
End With
NewRNG = RNG.Address
NewRNG.select
End Sub
**in this case, i can't set rng.address to a variable