ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search and move?? (https://www.excelbanter.com/excel-programming/345866-search-move.html)

Robert M. Gary[_2_]

Search and move??
 
I would like to create a macro that reads a value from a cell, switches
sheets, finds the cell value in the new sheet, then repositions the
window (scrolls) so you can see the entry (so its no below the screen).

I know I can select the value from the original cell by

Range("C3").Select
Selection.Copy
Sheets("Report").Select

but how to I actually do the find() and then bring the found value up
to the top of the screen?

Thanks so much in advance. I'm a Java programmer and still trying to
figure out VB. I'm looking for something like "javadocs".

-Robert


Don Guillett[_4_]

Search and move??
 
this should work
Sub gotovalue()
x = ActiveCelly = Sheets("sheet5").Cells.Find(x).Address
Application.Goto Sheets("sheet5").Range(y), Scroll:=True

End Sub

--
Don Guillett
SalesAid Software

"Robert M. Gary" wrote in message
oups.com...
I would like to create a macro that reads a value from a cell, switches
sheets, finds the cell value in the new sheet, then repositions the
window (scrolls) so you can see the entry (so its no below the screen).

I know I can select the value from the original cell by

Range("C3").Select
Selection.Copy
Sheets("Report").Select

but how to I actually do the find() and then bring the found value up
to the top of the screen?

Thanks so much in advance. I'm a Java programmer and still trying to
figure out VB. I'm looking for something like "javadocs".

-Robert




Don Guillett[_4_]

Search and move??
 
corrected word wrap

Sub gotovalue()
x = ActiveCell
y = Sheets("sheet5").Cells.Find(x).Address
Application.Goto Sheets("sheet5").Range(y), Scroll:=True
End Sub


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
this should work
Sub gotovalue()
x = ActiveCelly = Sheets("sheet5").Cells.Find(x).Address
Application.Goto Sheets("sheet5").Range(y), Scroll:=True

End Sub

--
Don Guillett
SalesAid Software

"Robert M. Gary" wrote in message
oups.com...
I would like to create a macro that reads a value from a cell, switches
sheets, finds the cell value in the new sheet, then repositions the
window (scrolls) so you can see the entry (so its no below the screen).

I know I can select the value from the original cell by

Range("C3").Select
Selection.Copy
Sheets("Report").Select

but how to I actually do the find() and then bring the found value up
to the top of the screen?

Thanks so much in advance. I'm a Java programmer and still trying to
figure out VB. I'm looking for something like "javadocs".

-Robert






Robert M. Gary[_2_]

Search and move??
 
Ah man you rock!! That's perfect! Thanks!!

-Robert


Don Guillett[_4_]

Search and move??
 
glad it helped


--
Don Guillett
SalesAid Software

"Robert M. Gary" wrote in message
ups.com...
Ah man you rock!! That's perfect! Thanks!!

-Robert





All times are GMT +1. The time now is 12:28 PM.

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