I am trying to name a range based on a .Find then define that range as my variable so I can enter the variable into a different function. When I run the code I get a type mismatch error.
Sub Faked() Dim r As Range Cells.Find(What:="EE status", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate Range(Selection, Selection.End(xlDown)).Name = "Win" Set r = ("Win") End Sub
Set r = range("Win")for each c in r | debug.print c | next?Debug.Print r.Addressit will show you the range address in the immediate window.