Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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 -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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 -





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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 -





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find, Copy offset to offset on other sheet, Run-time 1004. Finny[_3_] Excel Programming 10 December 7th 06 11:46 PM
macro -find all occurences of a word-change color of cell of all Lost in Alabama Excel Programming 2 January 17th 06 01:46 PM
find word in a cell then change cell format [email protected] Excel Programming 2 May 23rd 05 01:21 PM
vba help pls - find min based on a condition and return val of an offset cell Impakt Excel Programming 2 May 17th 05 12:40 AM
VBA: Add cell value to another worksheet cell using Find and offset Caméléon Excel Programming 2 February 15th 05 04:07 AM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"