Scroll Left

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
1,835
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Code:
Application.Goto Reference:=Range("a1"), Scroll:=True

I found this works, but can you not select the cell.
Aim is to scroll to Home (left) in the Worksheet only.

Thanks.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
This script selects the cell for me.
What do you want to do with Range("A1")

What cell do you want to select?
Some cell has to be selected.

Try this:
Code:
Sub GotoMe()
'Modified  7/2/2019  1:07:06 AM  EDT
Application.Goto Reference:=Range("a1"), Scroll:=True
Selection.Value = "Cake"
End Sub
 
Last edited:
Upvote 0
Aim is to scroll to Home (left) in the Worksheet only.
This statement is not entirely clear. Do you mean you want to scroll to Column A but in the row that is currently active?

Or do you mean you want to scroll to the left side of the currently displayed section of the worksheet no matter what column is on the left side? In other words if the displayed range of cells is Q25:AP65 and cell Z40 is active, then you want to activate cell Q40 without scrolling anything?
 
Last edited:
Upvote 0
Do you mean you want to scroll to Column A but in the row that is currently active?
If this is what you want, then give this code line a try...

Intersect(ActiveCell.EntireRow, Columns("A")).Select



Or do you mean you want to scroll to the left side of the currently displayed section of the worksheet no matter what column is on the left side? In other words if the displayed range of cells is Q25:AP65 and cell Z40 is active, then you want to activate cell Q40 without scrolling anything?
If this is what you want, then give this code line a try...

Intersect(ActiveCell.EntireRow, ActiveWindow.VisibleRange)(1).Select
 
Upvote 0
When my code finishes (formatting the sheet) I have to scroll all the way to the left (if I want to see the worksheet starting from Col A).
If possible Is like to to automate that step but without selecting a cell, as no cell needs to be selected.
 
Upvote 0
Try this:
Code:
Sub Scroll_Me()
'Modified  7/2/2019  1:32:02 AM  EDT
Dim ans As Long
ans = ActiveCell.Column
ActiveWindow.SmallScroll ToRight:=-ans
End Sub
 
Upvote 0
When my code finishes (formatting the sheet) I have to scroll all the way to the left (if I want to see the worksheet starting from Col A).
If possible Is like to to automate that step but without selecting a cell, as no cell needs to be selected.
Well, one cell always has to be active no matter what. Are you saying you want to leave whatever cell is active still the active cell and scroll left even if that means the active cell will no longer be visible? If so, give this code line a try...

ActiveWindow.ScrollColumn = 1
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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