Need macro to search & replace formula with value

P

polarbearchp

I need to have a macro that will search the spreadsheet and when th
value goes to 1 then replace this formula with the value 1. So an
cell that ever solves for 1 will always remain 1. This can be manuall
started.
Your assistance is appreciated.
Thanks,
Car
 
F

Frank Kabel

Hi
try something like the following (works on the current selection):

sub foo()
dim rng as range
dim cell as range
set rng = selection
for each cell in rng
if cell.value=1 then
cell.value=cell.value
end if
next
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top