gtd526
Well-known Member
- Joined
- Jul 30, 2013
- Messages
- 684
- Office Version
- 2019
- Platform
- Windows
Hello,
I want to remove unwanted text "(35-11)" from BF:BF. I have the following macro, but it doesn't work.
Thank you.
I want to remove unwanted text "(35-11)" from BF:BF. I have the following macro, but it doesn't work.
Thank you.
VBA Code:
Sub Test()
Sheets("TeamRankings").Select 'Teamrankings
'vs Rank
Application.ScreenUpdating = False
lastRow = Cells.Find("(", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For Each Rng In Range("BF3:BF" & lastRow)
If InStr(Rng, "(") > 0 Then
Rng = Mid(Rng, 1, WorksheetFunction.Find("(", Rng) - 2) 'rid of extra space
End If
Next Rng
Application.ScreenUpdating = True
End Sub
Cell Formulas | ||
---|---|---|
Range | Formula | |
BD2:BD12 | BD2 | =IF(BF:BF="Milwaukee","MIL",IF(BF:BF="LA Lakers","LAL",IF(BF:BF="Dallas","DAL",IF(BF:BF="Boston","BOS",IF(BF:BF="LA Clippers","LAC",IF(BF:BF="Toronto","TOR",IF(BF:BF="Utah","UTA",IF(BF:BF="Houston","HOU",IF(BF:BF="Denver","DEN",IF(BF:BF="Miami","MIA",IF(BF:BF="Okla City","OKC",IF(BF:BF="Philadelphia","PHI",IF(BF:BF="Indiana","IND",IF(BF:BF="New Orleans","NO",IF(BF:BF="San Antonio","SAN",IF(BF:BF="Brooklyn","BRK",IF(BF:BF="Portland","POR",IF(BF:BF="Phoenix","PHX",IF(BF:BF="Orlando","ORL",IF(BF:BF="Memphis","MEM",IF(BF:BF="Sacramento","SAC",IF(BF:BF="Minnesota","MIN",IF(BF:BF="Detroit","DET",IF(BF:BF="Chicago","CHI",IF(BF:BF="Washington","WAS",IF(BF:BF="New York","NYK",IF(BF:BF="Atlanta","ATL",IF(BF:BF="Charlotte","CHA",IF(BF:BF="Golden State","GS",IF(BF:BF="Cleveland","CLE","")))))))))))))))))))))))))))))) |