yasha Posted October 5, 2018 Posted October 5, 2018 so I would like to know is there any way to delete rows with specific number in excel without disturbing other cells using autoit example 10 rows are present and 6 rows have the number 3 and the rest is other number I want to delete of all the 3 s
FrancescoDiMuro Posted October 5, 2018 Posted October 5, 2018 @yasha Take a look at Excel UDF Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
yasha Posted October 5, 2018 Author Posted October 5, 2018 (edited) I can use macro to filter but the problem come when I want to delete cause I get huge documents with different ranges and have to sort them I need a program that deletes for example. colum B has 300 from rows 20 to 60 and the rest is other numbers I want to completely remove the range that has 300 and it is different for different documents. Edited October 5, 2018 by yasha
FrancescoDiMuro Posted October 5, 2018 Posted October 5, 2018 (edited) @yasha Did you look at what I've pointed you out 10 minutes ago? Post some example then. Edited October 5, 2018 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Subz Posted October 5, 2018 Posted October 5, 2018 Here are a couple of methods to do it: #include <Array.au3> #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\Book1.xlsx") MsgBox(4096, "Remove Range B20:B60", "Delete Range B20 to B60") For $i = 60 To 20 Step - 1 _Excel_RangeDelete($oWorkbook.ActiveSheet, "B" & $i, $xlShiftUp, 1) Next MsgBox(4096, "Remove All Instances", "Removes all rows with 300 in B:B Range") Local $aRangeFind = _Excel_RangeFind($oWorkbook, 300, "B:B", Default, $xlWhole) For $i = UBound($aRangeFind) - 1 To 0 Step - 1 _Excel_RangeDelete($oWorkbook.ActiveSheet, $aRangeFind[$i][2], $xlShiftUp, 1) Next
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now