Excel_Learner29
New Member
- Joined
- Apr 1, 2019
- Messages
- 5
Hi, i am trying to unprotect my worksheet to run below code for converting columns into text and then protect sheet again but somehow its not working.
Please help!
Sub EWEB2()
Dim ws As Worksheet
Set ws = Worksheets("EWEB")
ws.Select
ws.Unprotect Password:="dim"
Columns("G:G").Select
Selection.TextToColumns Destination:=Range("G1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
ws.Protect Password:="dim", DrawingObjects:=True, contents:=True, Scenarios:=True, AllowFiltering:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, UserInterFaceOnly:=True
End Sub
Please help!
Sub EWEB2()
Dim ws As Worksheet
Set ws = Worksheets("EWEB")
ws.Select
ws.Unprotect Password:="dim"
Columns("G:G").Select
Selection.TextToColumns Destination:=Range("G1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
ws.Protect Password:="dim", DrawingObjects:=True, contents:=True, Scenarios:=True, AllowFiltering:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, UserInterFaceOnly:=True
End Sub