I am currently trying to delete columns B thru I in a particular row. I have tried many combinations by setting a range. The row will be the variable. I could only delete one or many based on a loop.
I can successfully delete a entire row which used to be useful. But I have since added data to the right of Row I That cannot be deleted.
Application.DisplayAlerts = False
For I = 5 To cell2
name = Sheet4.Range("D" & I).value
Set rgFound = Sheet1.Range("B5:B9999").Find(name)
'Delete columns B thru I on sheet1
myRow = rgFound.Row
Sheet1.Range("B" & myRow, "I" & myRow).Delete shift:=xlToUp
'delete the sheet
Sheets(name).Delete
Next I
Application.DisplayAlerts = True
I can successfully delete a entire row which used to be useful. But I have since added data to the right of Row I That cannot be deleted.
Application.DisplayAlerts = False
For I = 5 To cell2
name = Sheet4.Range("D" & I).value
Set rgFound = Sheet1.Range("B5:B9999").Find(name)
'Delete columns B thru I on sheet1
myRow = rgFound.Row
Sheet1.Range("B" & myRow, "I" & myRow).Delete shift:=xlToUp
'delete the sheet
Sheets(name).Delete
Next I
Application.DisplayAlerts = True