danovkos
07-28-2010, 01:38 AM
Hi all,
pls. i have a code, but it doesnt works as i wish...
This is only part of it, but here is something wrong..
what i try to do with this code is - From active cell i want only value without last 3 character. This value, i try to search in sheet ALL in column C. Now it works, but nothing is found (but the value is in column C). By debuging it return that value found has error 2042.
pls. can you help me?
Dim cif, cif2
Dim pval, pvall2 As String
Dim i
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Dim vysledok As String
Dim found As Variant
Dim Rng As Range
Dim LookFor As Range
Set Rng = Workbooks("file.xls").Sheets("ALL").Columns("C:D")
vysledok = Left(ActiveCell.Value, Len(ActiveCell.Value) - 3)
found = Application.VLookup(vysledok, Rng, 1, 0)
If IsError(found) = False Then GoTo cisloU
pls. i have a code, but it doesnt works as i wish...
This is only part of it, but here is something wrong..
what i try to do with this code is - From active cell i want only value without last 3 character. This value, i try to search in sheet ALL in column C. Now it works, but nothing is found (but the value is in column C). By debuging it return that value found has error 2042.
pls. can you help me?
Dim cif, cif2
Dim pval, pvall2 As String
Dim i
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Dim vysledok As String
Dim found As Variant
Dim Rng As Range
Dim LookFor As Range
Set Rng = Workbooks("file.xls").Sheets("ALL").Columns("C:D")
vysledok = Left(ActiveCell.Value, Len(ActiveCell.Value) - 3)
found = Application.VLookup(vysledok, Rng, 1, 0)
If IsError(found) = False Then GoTo cisloU