Uma Chauhan
New Member
- Joined
- Jul 30, 2019
- Messages
- 7
Hi Guys,
I am trying to run a piece of code in all the sheets in a workbook. However my code is only editing first sheet and then courses through other sheets but does not edit them. PFB the code:
Sub Worksheet_Editor()
For Each Worksheet In ThisWorkbook.Sheets
Cells.Select
Selection.Replace What:="NA", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
Next
ActiveWorkbook.Save
End Sub
I am trying to run a piece of code in all the sheets in a workbook. However my code is only editing first sheet and then courses through other sheets but does not edit them. PFB the code:
Sub Worksheet_Editor()
For Each Worksheet In ThisWorkbook.Sheets
Cells.Select
Selection.Replace What:="NA", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
Next
ActiveWorkbook.Save
End Sub