LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Find & Replace with two condition in VBA

Thank you Mr.Phillips for your answer,I found a sample code that detect the
last item,actualy I first need to find last item and then replace something
in column C
this code is :
Public Sub FindLast()
Dim rngFound As Range
Dim rngToSearch As Range
Set rngToSearch = Range("A2", Cells(Rows.Count, "A").End(xlUp))
Set rngFound = rngToSearch.Find(What:="2C2", _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchDirection:=xlPrevious)
If rngFound Is Nothing Then
MsgBox "Sorry... Not Found"
Else
REPLACEMENT
End If
End Sub
what I need now is just replace "test" to "BLK" in column c (in REPLACEMENT)
Thanks
"Bob Phillips" wrote:

Find and Replace (Ctrl-H) will do that, so just do it with the macro
recorder switched on.

--
__________________________________
HTH

Bob

"bijan" wrote in message
...
Hi All,
I have a sheet like this:
A B C
1 2B2 1 NRC
2 2B2 2 WW
3 2C2 1 BLK
4 2C2 2 BLK
5 2C2 3 BLK
How can I find 2C2 with value 3 in column B (row 5) and change BLK in
column
C
with whatever I want?




 
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 and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Find/Replace Event or Find/Replace for Protected Sheet ... Joe HM Excel Programming 2 October 27th 07 03:55 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Replace method - cannot find any data to replace Mike Excel Programming 5 April 6th 06 08:56 PM
Find and replace with condition Stuart Excel Discussion (Misc queries) 5 July 26th 05 12:47 PM


All times are GMT +1. The time now is 08:54 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"