I have two sheets in my worksheet;Sheet1 and Sheet2. Sheet1 allows user to enter file location and then ask the latter to select a range and then import data onto sheet2. However, there are 2 blank cells (that could obviously be removed manually) but I'm trying to automate the process but the code below tells me no cells have been found.
Sum DeleteRows()
Dim SrchNom
Dim Tb as Range
'we get sheet on which data has been copied
Set Tb = Sheet1.Range("E9")
Set SrchNom = Worksheets(Tb.Value).Range("J1", Worksheets(Tb.Value).Range("J1048576").End(xlUp))
SrchNom.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End sub
I want to be able to delete entire row if one cell in column J of sheet Tb is blank. How do I modify this code to be able to do what I am trying to do?
=len(j2)
return? – SJR