Find and replace in a different cell

P

PointerMan

If my data looks like this and I want to pick a number and have the cell
under it filled with a number of my choosing, what's my best option?

A 10 20 30 40 50

B 25 35 45 55 65

C 15 20 25 30 35
 
L

Luke M

Use VBA. Right click on sheet tab, view code, paste this in. Modify beginning
statements as desired.

Sub FindReplace()

'Value you want to find
xFind = 5
'Value you want to input
xReplace = 50
Cells.Find(What:=xFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.Offset(-1).Value = xReplace
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