ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Previously helped by Jacob Skaria -- need more help (https://www.excelbanter.com/excel-discussion-misc-queries/241268-previously-helped-jacob-skaria-need-more-help.html)

RGreen

Previously helped by Jacob Skaria -- need more help
 
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

Jacob Skaria

Previously helped by Jacob Skaria -- need more help
 
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
---------------
Jacob Skaria


"RGreen" wrote:

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



All times are GMT +1. The time now is 10:22 PM.

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