Hello,
I found the following code that will resize a column to the desired width.
Is there a way to make this VBA code run when a column is resized? Protecting the sheet is not an option.
I have the following VBA code below already in the sheet so I am hoping to incorporate the solution within that code.
Thank you!
I found the following code that will resize a column to the desired width.
VBA Code:
Sub Set_Column_Range_Width()
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
With MySheet.Columns("C")
.ColumnWidth = 52.27
End With
End Sub
Is there a way to make this VBA code run when a column is resized? Protecting the sheet is not an option.
I have the following VBA code below already in the sheet so I am hoping to incorporate the solution within that code.
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("H7:K7")
If Not Application.Intersect(KeyCells, Target) Is Nothing Then
Worksheets("CST View").PivotTables("AutoOL").PivotCache.Refresh
End If
End Sub
Thank you!