Update the data in excel instead of deleting -


the below code deleting records want update next column "ok" instead of deleting entire row. please advise changes required.

dim myfilenamedir string dim ws1 worksheet dim irow1 long dim str string   myfilenamedir = "c:\users\gshaikh\desktop\book16.xlsx" workbooks.open filename:=myfilenamedir, updatelinks:=0 set ws1 = worksheets("students")   str = listview1.selecteditem.subitems(1)  msgbox str       ws1       .autofiltermode = false       irow1 = .range("b" & .rows.count).end(xlup).row            .range("b1:d" & irow1)               .autofilter field:=1, criteria1:="=*" & str & "*"               .offset(1, 0).specialcells    (xlcelltypevisible).entirerow.delete           end          .autofiltermode = false     end  activeworkbook.save activeworkbook.close 

you need remove: (xlcelltypevisible).entirerow.delete

and replace cells.value = "ok"


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -