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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -