Macro

  • Thread starter Thread starter RA
  • Start date Start date
R

RA

Does anyone have a macro that will search column "B" for a
code (THZ) then look 4 lines up in Column "A" and copy
that information and paste next to the "THZ" in column "A"

RA
 
Dim LookUp as Integer
LookUp = 1
Do Until Cells(LookUp, 1).Value = ""
If Cells(LookUp, 2).Value = "THZ" Then
Cells(LookUp, 1).Value = Cells(LookUp - 4, 1).Value
End If
LookUp = LookUp + 1
Loop

Hope this helps
 
It doesn't appear to do anything. Also I mis-stated the
problem, the cell I want to copy is ten spaces higher than
the cell with the code THZ. THZ is in the B column and
the name is in the is in the A column.

The problem is that I get this data is an almost unusable
format. I save the data as a .txt file and then open it
in Excel. When the .txt file is opened the data comes
across in multiple lines and the code I'm looking for is
in column B in one line and the name associated with the
code is 10 lines above and in the A column.

RA
 
Back
Top