Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
finding and then moving entire row to new sheet based on cell value | Excel Discussion (Misc queries) | |||
Finding the Row number based on contents of a cell | Excel Worksheet Functions | |||
Finding a named range based on cell value and copy/paste to same sheet? | Excel Programming | |||
Finding cell contents based on certain criteria | Excel Discussion (Misc queries) | |||
Finding cell contents based on certain criteria | Excel Discussion (Misc queries) |