Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gents
I came up with the following after checking out another section of the code. It works really well and does almost everything I hoped it would do, with one exception, it does not trigger the Oops when a time is missing from the lookup... Sub Operating_Times() Dim TDLocCode As String Dim SDLocCode As String Dim Oops As Integer Sheets("MAIN DATA").Select For I = 6 To 30000 tLoad = Sheets("MAIN DATA").Range("D" & I).Value If tLoad = "" Then Exit For End If found = False If Sheets("MAIN DATA").Range("AG" & I).Value = "" Then TDLocCode = Trim(CStr(Sheets("MAIN DATA").Range("G" & I).Value)) For j = 11 To 30000 SDLocCode = Trim(CStr(Sheets("SUPPORT DATA").Range("D" & j).Value)) If SDLocCode = "" Then Exit For End If If SDLocCode = TDLocCode Then Sheets("MAIN DATA").Range("AG" & I).Value = Sheets("SUPPORT DATA").Range("G" & j).Value Sheets("MAIN DATA").Range("AH" & I).Value = Sheets("SUPPORT DATA").Range("H" & j).Value found = True Exit For End If Next j If found = False Then Oops = MsgBox("Vendor : " & Sheets("MAIN DATA").Range("H" & I).Value & " Does not appear to have Operating Times entered?", vbOKOnly) Cancel = True End If End If Next I End Sub Appreciate the look over TIA Mick |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vLookup with multiple lookup value in table array | Excel Worksheet Functions | |||
table, index, array, match, lookup? | Excel Worksheet Functions | |||
Variable Table Array in Lookup Function | Excel Worksheet Functions | |||
How do I delete a lookup table array name? | Excel Worksheet Functions | |||
how to lookup one source with alot of table array? | Excel Programming |