Sub Macro1()
Dim numeRo As Long
On Error Resume Next
Dim mylastrowe As Long
numeRo = 2
For numeRo = 2 To 6
With SheetnumeRo
mylastrowe = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
SheetnumeRo.Columns("B:B").TextToColumns Destination:=Range("B1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
1), Array(6, 1), Array(7, 1)), TrailingMinusNumbers:=True
'Delimits column B on the condition on a /.
SheetnumeRo.Columns("D:D").Replace What:="John", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
SheetnumeRo.Columns("B:B").Replace What:=":", Replacement:="://", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
SheetnumeRo.Sort.SortFields.Clear
SheetnumeRo.Sort.SortFields.Add Key:=Range("D1:D" & mylastrowe), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With SheetnumeRo.Sort
.SetRange Range("A1:P" & mylastrowe)
.Header = False
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
Next numeRo
End Sub
Ideally, this should just run for sheets 2-6, but obviously that doesn't happen. I also tried "With Sheet1 And Sheet2 And Sheet3...etc" but that doesn't work either. Is there any way to do this besides just copy/pasting this code over and over again for every worksheet?
Bookmarks