I was hoping someone could help with this piece of code. I wam trying to delete the entire row if I find the text 'FemImplant' in column A. The tricky part is that this text is part of a sentence linked by '$'. So I need the code to parse out the cell content before '$' and see if it matches 'FemImplant' and delete that row. This is what I have so far but it is nto working.
Dim cell As Excel.Range
RowCount = DataSheet.UsedRange.Rows.Count
Set col = DataSheet.Range("A1:A" & RowCount)
Dim SheetName As String
Dim ParsedCell() As String
For Each cell In col
ParsedCell = cell.Value.Split("$")
SheetName = ParsedCell(0)
If SheetName = "FemImplant" Then
cell.EntireRow.Delete Shift:=xlUp
End If
Next
Dim cell As Excel.Range
RowCount = DataSheet.UsedRange.Rows.Count
Set col = DataSheet.Range("A1:A" & RowCount)
Dim SheetName As String
Dim ParsedCell() As String
For Each cell In col
ParsedCell = cell.Value.Split("$")
SheetName = ParsedCell(0)
If SheetName = "FemImplant" Then
cell.EntireRow.Delete Shift:=xlUp
End If
Next