ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find word then use offset to change value in another cell (https://www.excelbanter.com/excel-programming/390873-find-word-then-use-offset-change-value-another-cell.html)

[email protected][_2_]

Find word then use offset to change value in another cell
 
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


Bob Phillips

Find word then use offset to change value in another cell
 
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)

wrote in message
ups.com...
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




[email protected][_2_]

Find word then use offset to change value in another cell
 
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

On 7 Jun, 12:55, "Bob Phillips" wrote:
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)

wrote in message

ups.com...



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- Hide quoted text -


- Show quoted text -




Bob Phillips

Find word then use offset to change value in another cell
 
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)

wrote in message
oups.com...
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

On 7 Jun, 12:55, "Bob Phillips" wrote:
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)

wrote in message

ups.com...



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- Hide quoted text -


- Show quoted text -






[email protected][_2_]

Find word then use offset to change value in another cell
 
Thanks so much Bob,

It worked without problems,

Andrea

On 7 Jun, 14:49, "Bob Phillips" wrote:
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)

wrote in message

oups.com...



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


On 7 Jun, 12:55, "Bob Phillips" wrote:
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)


wrote in message


roups.com...


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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com