How to add a formula using a macro

L

Lawribird

How do I find a string of characters like "?---?" on the worksheet then
replace them with the cell value in the cell directly above them using a
macro. For example I might find the "?---?" in C23 and need to replace it
with the value in B23. The value is always the one directly above. I know how
to "find/replace" but this seems to be creating an absolute reference despite
the fact that I don't have any $ preceeding the string.
Thanks
LP
 
A

Ashish Mathur

Hi,

Select the range, say B5:G560. Now pres Ctrl+F and in the find box, type
?---?. Click on Find All and then press Ctrl+A. This Now click on close.
This will select all the ?---? entries in the range B5:G560. Now perform
the foll steps:

1. Press =
2. Up arrow key;
3. Ctrl+Enter

All the ?---? will be replaced by the value in the cell above

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 

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