Vba/Match2tabels

From s23
< Vba
Revision as of 07:55, 26 February 2005 by imported>mutante
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Sub matchRouterNames_RoutersTab_RCLDump_MGTIP()

Worksheets("RCL.Dump").Select

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"

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

Next y

Worksheets("Routers").Select

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.