Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to change a value in a cell based on finding value in another

I want to perform a search of entire spreadsheet and when a specified value
is found a replace is performed in a specified cell of a specified value. I
want to code this in VB to be used as a macro.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default How to change a value in a cell based on finding value in another

Examples?

--
Don Guillett
SalesAid Software

"Laurie Born" <Laurie
wrote in message
...
I want to perform a search of entire spreadsheet and when a specified value
is found a replace is performed in a specified cell of a specified value.
I
want to code this in VB to be used as a macro.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How to change a value in a cell based on finding value in another

This might work. You will have to change a couple of items in the code where
I have so noted.

Sub srchWks()
Dim myRng As Range, myVar As Variant
Dim RangeToChange As Range, newValue As Variant
RangeToChange = Cells(5, 5) '<<< Change to actual
newValue = "Hello" '<<< Change to actual
Set myRng = ActiveSheet.UsedRange
With myRng
Set c = .Find(myVar, LookIn:=xlValues) '<<< Define myVar
If Not c Is Nothing Then
fRng = c.Address
RangeToChange.Value = newValue
End If
End With
End Sub

"Laurie Born" wrote:

I want to perform a search of entire spreadsheet and when a specified value
is found a replace is performed in a specified cell of a specified value. I
want to code this in VB to be used as a macro.

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
finding and then moving entire row to new sheet based on cell value dave chamberlan Excel Discussion (Misc queries) 2 November 17th 09 01:27 AM
Finding the Row number based on contents of a cell Chris Youlden Excel Worksheet Functions 5 September 6th 07 04:38 PM
Finding a named range based on cell value and copy/paste to same sheet? Simon Lloyd[_715_] Excel Programming 1 May 11th 06 11:25 PM
Finding cell contents based on certain criteria thekovinc Excel Discussion (Misc queries) 1 March 15th 06 07:37 PM
Finding cell contents based on certain criteria thekovinc Excel Discussion (Misc queries) 1 March 15th 06 07:20 PM


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

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"