Csibész
New Member
- Joined
- Nov 17, 2005
- Messages
- 10
Hi...
I don't get it... perhaps somebody could explain this to me.
The macro below is to find a given value in a range. If I use the actual value in Find, there's no problem. If I try to feed same through a variable (preferred way), it bombs out.
Sooo... Where do I go wrong and more importantly, how to do this right? Thanx in advance for any enlightenment!
Regards...
Sub Macro3()
TBFound = Range("A1").Value ' say it is =50
Sheets("1").Range("b1:b10").Find(TBFound, xlValue).Select
' using 50 instead of TBFound in Find - works
' using TBFound gives error
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TBFound
End Sub
I don't get it... perhaps somebody could explain this to me.
The macro below is to find a given value in a range. If I use the actual value in Find, there's no problem. If I try to feed same through a variable (preferred way), it bombs out.
Sooo... Where do I go wrong and more importantly, how to do this right? Thanx in advance for any enlightenment!
Regards...
Sub Macro3()
TBFound = Range("A1").Value ' say it is =50
Sheets("1").Range("b1:b10").Find(TBFound, xlValue).Select
' using 50 instead of TBFound in Find - works
' using TBFound gives error
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TBFound
End Sub