CELL - select and move to top ...

itr674

Well-known Member
Joined
Apr 10, 2002
Messages
1,778
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
 

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

itr674

Well-known Member
Joined
Apr 10, 2002
Messages
1,778
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??/
 

Expel

Board Regular
Joined
Nov 6, 2002
Messages
83
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,217
Messages
5,594,887
Members
413,947
Latest member
gizmolucy

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
Top