excel - Program code is deleting the data which I want to keep -


i have macro consolidate values on sheet, , based on these values, it´s has go on first sheet , delete. macro deleting want keep.

the sheet.

the macro: sub deleteothers()     dim r1 range, c range     dim t string      sheets("sheet2")         set r1 = .range(.cells(2, "h"), .cells(rows.count, "h").end(xlup))     end      each c in r1         if c.text = "<<<keep row"             sheets("sheet1").select             t = c.offset(0, -1)             rows(t).clearcontents         end if     next end sub 

change to:

if c.text <> "<<<keep row" 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -