Lock Scrolling of Columns

Farah

Board Regular
Joined
Oct 4, 2005
Messages
98
Hello,

Can we lock / disable column width scrolling through VBA ?

Warm Regards,
Farah
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Is this what you mean?

Worksheets("Sheet1").ScrollArea = "A:N"

Set it to empty string to reset it:
Worksheets("Sheet1").ScrollArea = ""
 
Upvote 0
hello,

not exactly that, i want that after i hide my column through VB (Entirecolumn.hidden = true), users should not be able to change the width of the certain columns which are hidden. So i wanted that the scrolling of width of certain columns can somehow be disabled.

Warm Regards,
Farah
 
Upvote 0
searching for "Warm Regards" I found my way to this "old" unsolved post

you can restrict the selection to only visible cells using this
Code:
Option Explicit

Dim flag As Boolean

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rng As Range

If flag = True Then Exit Sub
flag = True
Set rng = Intersect(Target, Cells.SpecialCells(xlCellTypeVisible))
If Not rng Is Nothing Then rng.Select
flag = False
End Sub
hide column F
select column EFG
try to change the width
F will remain invisible

if you don't have buttons to restore the column
type F1 in the namebox
menu format / column / unhide

of course protecting the sheet would disable columnwidthchanges

warm regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,223,195
Messages
6,170,661
Members
452,345
Latest member
ye4hb0i

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