Bruce_Tjosvold
New Member
- Joined
- Jul 19, 2011
- Messages
- 6
Hello all,
I am searching column A for a value and deriving the row. Hard coding the value works as expected. I can't seem to get the code to work using a variable
Value in quotes works, "DEV ". nMatch contains the correct row #.Variable with value "DEV" doesn't work. nMatch is 0.
Thanks
Bruce
I am searching column A for a value and deriving the row. Hard coding the value works as expected. I can't seem to get the code to work using a variable
Value in quotes works, "DEV ". nMatch contains the correct row #.Variable with value "DEV" doesn't work. nMatch is 0.
Code:
Dim nMatch As Long
DIM vref_sapsystem As String " contains "[B]DEV[/B]" when the match takes place
nMatch = Application.WorksheetFunction.Match([B]"DEV"[/B], Sheets(1).UsedRange.Columns(1), 0)
nMatch = Application.WorksheetFunction.Match([B]vref_sapsystem[/B], Sheets(1).UsedRange.Columns(1), 0)
Thanks
Bruce