I am having an issue. I have written code to find and select the second column in a table immediately below the title 'Association'. However, the next step is to go through the selected cells/range, select all rows with a value of 0.00% and then delete them.
For this I have written the following:
'Setting Variables
Dim cell As Range
Dim rngData As Range
'Selecting Range to go through and re-formatting
Sheets("Allocations").Select
Columns("A:A").Select
Selection.Find(What:="Association", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range("A19").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Hidden = False
ActiveCell.Offset(0, 1).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
'Attempting to delete just cells within current selection with a value of Zero
Set rngData = Selection
For Each cell In rngData
If cell.Value = 0 Then
Rows.Delete
End If
Next cell
End Sub
Right now it just deletes everything from the workbook which....isn't ideal haha
Appreciate any help I can get on this, I've done a lot of googling and am now pulling my hair out!
Thanks