Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to do a lookup, it doesn't error out and it goes through the
conditions, but it doesn't update the value. Any ideas? Dim Res as Variant z = 5 Do While Range("DCI!A" & z).Value = Date If CStr(Range("DCI!J" & z).Value) = "000" Then Res = Application.Lookup(Left(Range("DCI!D" & z), 3), Range("HTC!$A$2:$A$200"), Range("HTC!$B$2:$B$200")) If Not IsError(Res) Then Range("DCI!J" & z).Value = Res Else Range("DCI!J" & z).Value = "Not Found-" & Res End If End If z = z + 1 Loop |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have made a some progress on this, one minor problem. I took out the
error checking for now, it works when it compares characters to characters, but not numbers to numbers. I get this #N/A All fields are general z = 5 Do While Range("DCI!A" & z).Value = Date If Range("DCI!J" & z).Value = 0 Then Res = Application.Lookup(Left(Range("DCI!D" & z), 3), Range("HTC!$A$2:$A$81"), Range("HTC!$B$2:$B$81")) Range("DCI!J" & z).Value = Res End If z = z + 1 Loop If I modify this line to Range("DCI!J" & z).Value = CStr(Res), just added CSTR, I get Error 2042, what is this error? "Dthmtlgod" wrote in message ... I am trying to do a lookup, it doesn't error out and it goes through the conditions, but it doesn't update the value. Any ideas? Dim Res as Variant z = 5 Do While Range("DCI!A" & z).Value = Date If CStr(Range("DCI!J" & z).Value) = "000" Then Res = Application.Lookup(Left(Range("DCI!D" & z), 3), Range("HTC!$A$2:$A$200"), Range("HTC!$B$2:$B$200")) If Not IsError(Res) Then Range("DCI!J" & z).Value = Res Else Range("DCI!J" & z).Value = "Not Found-" & Res End If End If z = z + 1 Loop |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is wrong with my UDF | Excel Discussion (Misc queries) | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
wHAT AM i DOING wrong | Excel Worksheet Functions | |||
What am I doing wrong? | Excel Worksheet Functions | |||
what's wrong? | Excel Programming |