Macro task

D

dwboiler

Please help...

I have a spreadsheet that is created by downloading a list of seria
numbers and infromation about them, which is already done in a VB
macro which I didn't write. I would like to insert some macro into th
form which will compare the serial number with a bounce list of othe
serial numbers and if there is a match, then replace a cell with th
word "match" otherwise leave the value it currently has...however I a
new to VBA and don't know how to accomplish this...if you can offer an
help it would be grealty appreciated.

Thanks
d
 
B

Bob Phillips

cNumRows = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To cNumRows
Set oCell =
Worksheets("Sheet1").Range("H1:H100").Find(Cells(I,"A").Value)
If Not oCell Is Nothing Then
Cells(i,"B").Value = "Match")
Set oCell = Nothing
End If
Next i


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
D

dwboiler

Can you please explain what your variables are?

I am trying to decifer what belongs to each set of data.

Thank you Bob for all of the help. This looks like it will b
perfect.

-d
 
B

Bob Phillips

cNumRows simply works out the last non-empty row, and holds that row number.

oCell is a range object that holds the cell that the value is found in (or
Nothing if not found).

i is just a loop counter.

So cNumRows relates to the serial numbers downloaded, whilst oCel relates to
the bounce numbers.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top