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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,214,893
Messages
6,122,121
Members
449,066
Latest member
Andyg666

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