madvogue29
New Member
- Joined
- Aug 28, 2020
- Messages
- 32
- Office Version
- 365
- Platform
- Windows
Hi, is there way to stop user from resizing a text box ??
I have this script that brings it back to the pre determined size but is there a way to trigger it every time it is modified.
Ideally I would want this to be dynamic where it does that for all textboxes on the sheet ( if not, i understand)
Thanks in advance
I have this script that brings it back to the pre determined size but is there a way to trigger it every time it is modified.
Ideally I would want this to be dynamic where it does that for all textboxes on the sheet ( if not, i understand)
Thanks in advance
VBA Code:
Sub ResizeBox1()
Dim sTL As String
Dim sBR As String
Dim rng As Range
' Change top-left and bottom-right addresses as desired
sTL = "P3"
sBR = "d15"
' Ensure a text box is selected
ActiveSheet.Shapes.Range(Array("TextBox 1")).Select
With Selection
Set rng = ActiveSheet.Range(sTL)
.Top = rng.Top
.Left = rng.Left
Set rng = ActiveSheet.Range(sBR)
.Width = rng.Left + rng.Width
.Height = rng.Top + rng.Height
End With
Set rng = Nothing
End Sub