CELL - select and move to top ...

itr674

Well-known Member
Joined
Apr 10, 2002
Messages
1,786
Office Version
  1. 2016
Platform
  1. Windows
I'm using the following code to jump to a certain cell, but I need selected cell to move to the top of the active window that it moves to. The code is executed when a control button on a custom command bar is clicked ...

the numbers 1111, 2222, 3333, 4444, 5555 are in cells a1, a10, a20, a30, a40 on sheet named 1111-5555.<pre>Sub GoTo3333()
Sheets("1111-5555").Select
Range("A1:A50").Find("3333").Select
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 20
ActiveWindow.Zoom = 100
End Sub</pre>
This message was edited by em on 2003-01-31 23:48
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Well I figured out part of it. If I put the row number that 3333 is in that will take it to the top. But isnt there a way to do it withour have to put the row number in the procedure??/
 
Upvote 0
You could try this

Sub GotoNum()
Dim Num As String
Num = InputBox("Enter number to find", "FindNum")

Range("A:A").Find(Num).Activate
ActiveWindow.ScrollRow = ActiveCell.Row

End Sub

In this case the value required is entered in an input box.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top