Previously helped by Jacob Skaria -- need more help

R

RGreen

Try the below macro

Sub Macro()
Dim varFound As Variant
Set varFound = Columns(ActiveCell.Column).Find("Stop")
If Not varfound Is Nothing Then varfound.Offset(-1, 0).Activate
End Sub


The above macro was posted by Jacob Skaria -- my active cell is the cell
above the word stop for that column. I have been messing round, but I keep
running endless issues. What I now need is from that active cell, I need to
go to Column B:B, go up and find the word "Reserve" go down 3 cells (Column
B), copy that value go back to the active cell above the word "Stop" go down
2 cells and paste that value only into that cell and finally go one cell
above the cell which has the word stop. One more catch if the word reserve
is not there, than do nothing.

In my example Say if the word stop is columns CY772, I need to go to B753
copy the values from B756 go back to CY773 and end up at CY771
 
J

Jacob Skaria

Hi Again

Modified the macro which returns the value of (3 cells down to Reserve) in
Column B to (one cell down to Stop)...Try and feedback


Sub Macro()

Dim varFound As Variant
Set varFound = Range(ActiveCell, Cells(Rows.Count, _
ActiveCell.Column).End(xlUp)).Find("Stop")
If Not varFound Is Nothing Then
varFound.Offset(-1, 0).Activate
Set varFound = Range("B" & ActiveCell.Row & ":B1").Find(What:="Reserve", _
SearchDirection:=xlPrevious)
If Not varFound Is Nothing Then
ActiveCell.Offset(2) = varFound.Offset(3).Value
End If
End If

End Sub

If this post helps click Yes
 

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