ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Query replace by VBA (https://www.excelbanter.com/excel-programming/302660-query-replace-vba.html)

kaon[_4_]

Query replace by VBA
 
Hi all,

I have 5x cells with the formula like
VLOOKUP(B3,PNOA!A:Z, 4, FALSE) / 1000

How can I do query replace the 4 by other value, say 10, for cell
having the similar formula? To be precise, I wonder how can I replac
the 4 without using functions like left(), right()?

Thanks in advance

--
Message posted from http://www.ExcelForum.com


DFStoneJr[_2_]

Query replace by VBA
 
Use search and replace.

Press CTRL-H, enter ",4," in the"Find what" box and ",10," in the "replace
with" box.



"kaon " wrote in message
...
Hi all,

I have 5x cells with the formula like
VLOOKUP(B3,PNOA!A:Z, 4, FALSE) / 1000

How can I do query replace the 4 by other value, say 10, for cells
having the similar formula? To be precise, I wonder how can I replace
the 4 without using functions like left(), right()?

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy[_20_]

Query replace by VBA
 
Select the cells that contain the formula. If they are not together
you can select as big a group as you want to include them all as lon
as the ones you don't want changed to not contain an identical searc
string.

then do Edit=Replace

Replace What: 4, FALSE)

Replace with: 10, FALSE)

Do you formulas really have spaces in them. If so, place them in th
search strings so it is an exact match. Anyway, you want to get
unique "target" so you don't change things you don't want changed.

Leave Find Entire Cells Only unchecked and use Match Case a
appropriate.

So no code required.

--
Regards,
Tom Ogilv

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:30 PM.

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