Creating a macro to delete rows in Excel using VB -
i need code delete enitre row when specific name typed column a. so, each row has "surgery" in column a, needs deleted. thanks.
this should work. need change value of areatosearch fit workbook. watch case on keyword, "surgery" , "surgery" not same! tested , worked on sheet made up.
option explicit sub deletesurgery() dim keyword string dim cell range, areatosearch range keyword = "surgery" set areatosearch = sheet1.range("a1:a10") each cell in areatosearch if cell.value = keyword cell.entirerow.delete end if next cell end sub
Comments
Post a Comment