Find word then use offset to change value in another cell

  • Thread starter Thread starter amorrison2006
  • Start date Start date
A

amorrison2006

Hi,

I need to find the word books then go three columns along and multiply
the cell value by 2.

the macro should then look for every occurence of the word books and
do this,

if the word books is not found I'd like it to continue to the next
part of the macro......


I appreciate your help,

thanks so much,

im too old to learn this but you all saved me alot of time in my work,

Andrea
 
Look at Find and FindNext in VBA help.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Hi Bob,

I have but I dont understand how it works and how i can find a word in
column B and change the value in column C corresponding with that,

Can you help with a simple macro for this please?

Andrea
 
Sub UpdateData()
Dim oCell As Range
Dim sFirst As String
With Worksheets("Sheet5").Range("B:B")
Set oCell = .Find("word", LookIn:=xlValues)
If Not oCell Is Nothing Then
sFirst = oCell.Address
Do
oCell.Offset(0, 1).Value = oCell.Offset(0, 1).Value * 2
Set oCell = .FindNext(oCell)
Loop While Not oCell Is Nothing And oCell.Address <> sFirst
End If
End With
End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Back
Top