From s23
< Vba
Revision as of 13:40, 21 December 2004 by imported>DrOwl (*match data in 2 diffrent sheets)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Sub matchRouterNames_RoutersTab_RCLDump_MGTIP()


For y = 2 To 6

RouterName = Range("Routers!A" & y).Value & "-BVI1" Range("A1").Select

   Set x = Range("A:A").Find(What:=RouterName, After:=ActiveCell, LookIn:=xlValues, _
       LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=Falce)
   If x Is Nothing Then

Range("Routers!C" & y).Value = "not Found"

       Cells(x.Row, x.Column).Select
       FoundRow = x.Row
       Range("Routers!C" & y).Value = Range("B" & FoundRow).Value
   End If

Next y


End Sub

this macro will get an index from one sheet, try to find it on another sheet and then will copy info back to the main sheet.

sorry if that makes no sence i will clean it up when i have the time.