Hi! I have been looking and asking for solutions everywhere to find how to let the user autofit the columns when the figures are shown with ########
The best I could find was something like the code below but it doesn't work and on the other hand I want to make the macro work ONLY for the cells that the user selected firstly (not for the whole sheet)
By the way, how can I add also a warning so the user can cancel the procedure before doing any change?
Many many thanks.
Gerónimo
ps: I know that crossposting is not so popular but it's hard to have some help sometimes and I am quite rookie developing excel. Here you will find an old post I made How to autofit only selected cells
The best I could find was something like the code below but it doesn't work and on the other hand I want to make the macro work ONLY for the cells that the user selected firstly (not for the whole sheet)
Code:
Private Sub Autofit()
If Me.ProtectContents = True Then
Me.Unprotect Password:="test"
Me.Rows.AutoFit
Me.Protect Password:="test"
End If
End Sub
By the way, how can I add also a warning so the user can cancel the procedure before doing any change?
Many many thanks.
Gerónimo
ps: I know that crossposting is not so popular but it's hard to have some help sometimes and I am quite rookie developing excel. Here you will find an old post I made How to autofit only selected cells