Hello everyone. This is my second post and I need your help with this two VBA Statements.
By surfing the forum, I found this VBA Code that help me to delete rows with specific text which is entered in Dialog Box (See Code below).
Sub DeleteRows()
Dim c As Range
Dim SrchRng As Range
Dim SrchStr As String
Set SrchRng = ActiveSheet.Range("C1", ActiveSheet.Range("C65536").End(xlUp))
SrchStr = InputBox("Please Enter A Search location to delete")
Do
Set c = SrchRng.Find(SrchStr, LookIn:=xlValues)
If Not c Is Nothing Then c.EntireRow.Delete
Loop While Not c Is Nothing
End Sub
With the second code (cortesy of oeldere) it helps me to align miscontinued rows of data (See code below):
Sub filldata_decending_incolumnA()
'from below to the top (decending)
Range(Range("I2:O2"), Cells(Rows.Count, 9).End(xlUp).Offset(, -1)). _
SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[1]C"
With Columns("I:O")
.Value = .Value
End With
With Columns("A").SpecialCells(xlCellTypeBlanks).Cells
.EntireRow.Delete shift:=xlUp
End With
If Err.Number <> 0 Then MsgBox "There are no or only empty cells"
End Sub
Can anyone help me to combine this two VBA Codes into a single one?? I am practically new in VBA Codes. I know is not only Copy-Paste and done. I know that programming needs references to start and end with the first statement and continue with next and end it. So this is why I ask for your help.
I am attaching a file to test the new combined VBA code. I will really appreciate the big favor and your ideas.
I Hope this reply meets rule #3 of Forum Rules.
Sam Cruz.
Matamoros, Mexico.
Bookmarks