Hi All i have two issue in below code.
1. its give me Run time error 1004: cannot proceed as sheet is protected, when it is not protected.
2. i want it to run from 3 sheet to run till last sheet,,,but it is keep running on 1 sheet only.
please help!!
1. its give me Run time error 1004: cannot proceed as sheet is protected, when it is not protected.
2. i want it to run from 3 sheet to run till last sheet,,,but it is keep running on 1 sheet only.
Code:
Sub MacroTest()
Dim i As Integer
For i = 3 To Worksheets.Count
Application.DisplayAlerts = False
Sheets(i).Activate
' Sheets(i).Unprotect "conso"
Columns("A:A").EntireColumn.Select
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="*", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1)), _
DecimalSeparator:=",", ThousandsSeparator:=".", TrailingMinusNumbers:= _
True
ActiveCell.Range("A1").Select
Cells.Replace What:="=-", Replacement:="", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
ActiveCell.Columns("E:I").EntireColumn.Select
ActiveCell.Columns("E:I").EntireColumn.EntireColumn.AutoFit
Application.DisplayAlerts = True
Next i
End Sub
please help!!
Last edited by a moderator: