久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

如果找到N / A,,VBA excel代碼刪除行(VBA excel code to delete ...

 Excel實用知識 2021-12-17

如果找到N / A,VBA excel代碼刪除行(VBA excel code to delete the rows if N/A is found)

我正在尋找一種方法來找到整列中的N/A單元格,,然后如果找到N/A則刪除整行,。 我找到了這個VBA代碼,但它對我不起作用,,因為它只選擇一列,。 請幫忙(我在Excel Mac 2011中處理大約300000行)

Sub DeleteBlankARows() 
    With Application 
        .Calculation = xlCalculationManual 
        .ScreenUpdating = False 
        Dim r As Long 
        For r = Cells(Rows.Count, 11).End(xlUp).Row To 1 Step -1 
            If Cells(r, 11) = '' Then Rows(r).Delete 
        Next r 
        .Calculation = xlCalculationAutomatic 
        .ScreenUpdating = True 
    End With 
End Sub 

I am looking for a way to find the N/A cells in the entire columns and then delete the entire row if N/A is found. I found this VBA code, but it just doesn't work for me because it selects only one column. Please help (I am working on around 300000 rows in Excel Mac 2011)

Sub DeleteBlankARows() With Application .Calculation = xlCalculationManual .ScreenUpdating = False Dim r As Long For r = Cells(Rows.Count, 11).End(xlUp).Row To 1 Step -1 If Cells(r, 11) = '' Then Rows(r).Delete Next r .Calculation = xlCalculationAutomatic .ScreenUpdating = True End With End Sub

原文:https:///questions/10612072
2021-09-06 16:09

滿意答案

試試這個(在Windows XP / Excel 2007上測試但它應(yīng)該適用于Mac / Office 2011):

Option Explicit Sub DeleteNARows() Dim r As Long Dim iCol As Long With Application .Calculation = xlCalculationManual .ScreenUpdating = False .DisplayAlerts = False For iCol = 1 To Cells(1, Columns.Count).End(xlToLeft).Column For r = Cells(Rows.Count, iCol).End(xlUp).Row To 1 Step -1 If Application.WorksheetFunction.IsNA(Cells(r, iCol)) Then Rows(r).Delete Next r Next iCol .Calculation = xlCalculationAutomatic .ScreenUpdating = True .DisplayAlerts = True End With End Sub

請注意,您可以(并且可能必須)更改要在代碼開頭檢查#N #N/A的列


Try this (tested on Windows XP / Excel 2007 but it should work on Mac / Office 2011):

Option Explicit

Sub DeleteNARows()
    Dim r As Long
    Dim iCol As Long
    With Application
        .Calculation = xlCalculationManual
        .ScreenUpdating = False
        .DisplayAlerts = False
        For iCol = 1 To Cells(1, Columns.Count).End(xlToLeft).Column
            For r = Cells(Rows.Count, iCol).End(xlUp).Row To 1 Step -1
                If Application.WorksheetFunction.IsNA(Cells(r, iCol)) Then Rows(r).Delete
            Next r
        Next iCol
        .Calculation = xlCalculationAutomatic
        .ScreenUpdating = True
        .DisplayAlerts = True
    End With
End Sub

Note that you can (and probably have to) change the column where you want to check fot #N/A at the begining of the code

相關(guān)問答

更多

如果找到N / A,,VBA excel代碼刪除行(VBA excel code to delete the rows if N/A is found)

試試這個(在Windows XP / Excel 2007上測試但它應(yīng)該適用于Mac / Office 2011): Option Explicit Sub DeleteNARows() Dim r As Long Dim iCol As Long With Application .Calculation = xlCalculationManual .ScreenUpdating = False .DisplayAlert...

Excel VBA刪除行(Excel VBA Delete Rows)

這是刪除行時的常見問題,。 想象一下,您正在逐行移動一行for循環(huán)并刪除: For cnt = 7 To dlt Rows(cnt).EntireRow.Delete cnt = cnt + 1 Next 你在第7行,,你刪除它,。 這會將所有行向上移動。 第8行現(xiàn)在是第7行,。然后你將你的cnt變量增加1(到8)并刪除第8行,。但你錯過了第7行,這是第8行......這是瘋狂的香蕉,。 相反,,將for循環(huán)更改為向后工作: For cnt = dlt to 7 step -1 Ro...

VBA刪除Excel上給定范圍內(nèi)的空白行[復(fù)制](VBA Delete blank rows in a given range on Excel [duplicate])

您需要從范圍的末尾向后循環(huán)并刪除相關(guān)的行索引,如下所示 for x=numrows to 1 step -1 if ws.range('a' & x).value='' then ws.rows(x).delete next x 其中ws是您正在處理的工作表,。 You need to loop backwards from the end of the range and delete the relevant row index, like so for x=numrows to 1...

在Excel VBA中刪除表名(Delete table name in Excel VBA)

您可以從表中備份數(shù)據(jù),,刪除表并還原數(shù)據(jù)。 Sub test() Dim rng As Range Dim rngVals As Variant Set rng = YourSheet.ListObjects('Table2').Range rngVals = rng.Value YourSheet.ListObjects('Table2').Delete rng.Value = rngVals Set rng = Nothing En...

Excel VBA:如果單元格不包含表中的值,,則刪除行(Excel VBA: delete rows if cells do not contain values from a table)

干得好: Sub Remove_Rows() Dim i As Long i = Range('C' & Cells.Rows.Count).End(xlUp).Row ' Find the bottom row number Do Until i = 1 ' This loops to the top row before stopping (assuming you have a header row that you want to keep) If WorksheetFunct...

刪除vba excel中的行,,但只刪除備用行[復(fù)制](Deleting rows in vba excel, but only alternate rows being deleted [duplicate])

刪除行時,您必須認(rèn)識到您正在刪除正在循環(huán)的相同行,。 我的建議是從最后一行開始,,使用-1循環(huán)計數(shù)器進行迭代。 這樣,,您可以安全地刪除一行而不影響剩余的行,。 換句話說 - 從lastRow向后迭代到2(或者你的起始行是什么),。 When deleting rows, you have to realize that you're deleting the same rows that you're looping through. My suggestion is to start from the ...

在VBA的excel中刪除每n行(delete every n rows in excel with VBA)

Powerquery(2016,在數(shù)據(jù)選項卡>獲取和變換,,2013免費加載項從微軟然后powerquery選項卡) 絕對是針對您提到的行數(shù)的這種操作進行了優(yōu)化。 編寫查詢需要1分鐘時間,。 .66 of a second on a test with 200K rows to complete task. 1)選擇數(shù)據(jù)中的行,,然后從表中選擇數(shù)據(jù)> 2)指出你的表是否有標(biāo)題 3)查詢編輯器屏幕彈出 4)選擇主頁>刪除行>刪除備用行 5)指定模式。 例如,,保持1刪除3在你的例子中: 6)點擊確定,。 遵...

如何使用excel VBA刪除第一列中包含特定代碼的行?(How to delete a row that contains a certain code in the first column using excel VBA?)

根據(jù)你的敘述(“我必須......刪除一行”)你似乎只打擾了一句“CFS-GHOST-DJKT” 在這種情況下,,不需要迭代單元格,,只需嘗試找到它,如果成功,,則刪除整行 Dim f As Range Set f = Range('A7', Cells(Rows.Count, 'A').End(xlUp)).Find(what:='CFS-GHOST-DJKT', LookIn:=xlValues, lookat:=xlPart) If Not f Is Nothing Th...

Excel VBA:確定找到值的行(Excel VBA: determing rows on which the value is found)

我更喜歡MATCH來查找單列搜索: Set rep = Sheets('Details') Dim test As Long For i = 2 To n test = 0 On Error Resume Next test = Application.WorksheetFunction.Match(Worksheets('Work_report').Range('E' & i).Value, Sheets('Work').Range('A:A'), 0) On E...

刪除文件夾VBA中的非Excel文件(Delete non-Excel Files in a folder VBA)

使用以下應(yīng)該按要求,。 注意,最好使用Like運算符來比較部分字符串,,在這種情況下,, Not運算符只搜索那些不匹配的字符串。 strFileName = Dir('C:\test\*') Do While strFileName <> '' If Not lcase$(strFileName) Like '*.xls' Then 'or .txt or .csv or whatever Kill 'C:\test\' & strFileName End If strFileNa...

相關(guān)文章

更多

原創(chuàng):如何實現(xiàn)在Excel通過循環(huán)語句設(shè)置指定行的格式

原創(chuàng):如何實現(xiàn)在Excel通過循環(huán)語句設(shè)置指定行的格式 一,、需求: 想讓excel的某些行(比如3的倍 ...

reading notes for solr source code

solr source code 1 org.apache.solr.common 基本的類對象 ...

HttpClient DELETE請求示例

本教程演示如何使用Apache HttpClient 4.5創(chuàng)建Http DELETE請求,。 HTTP ...

[轉(zhuǎn)]So You Want To Be A Producer

pro-du-cer n. 1. Someone from a game publisher who ...

JXLS根據(jù)excel模板生成EXCEL并下載

JXLS根據(jù)excel模板生成EXCEL并下載,jxl.jar,jxls-core-0.9.9.jar ...

English,The Da Vinci Code,Chapter 1-3

CHAPTER 1 http:///thrillers/TheDaVi ...

solr delete query

Solr1.4 Both delete by id and delete by query can b ...

POI 操作Excel公式

在執(zhí)行這個公式

這種的EXCEL表格 怎么來解析?,?

如圖的EXCEL表格 怎么來解析,??

Becoming a data scientist

Data Week: Becoming a data scientist Data Pointed, ...

最新問答

更多

Microsoft Cognitive API可以在本地云中使用嗎,?(Can Microsoft Cognitive APIs be used in local cloud)

簡短的回答是不可能的,。 目前沒有本地部署支持。 并沒有具體的計劃來支持這一點,。 A short answer is not possible. Current there is no local deployment support. And there is no specific plan to support that too.

用事件調(diào)度線程構(gòu)造GUI并進行賦值(construct GUI with event dispatch thread and make assignment)

對于那些有一天應(yīng)該對這個問題感興趣的人來說,,這就是解決方案:我犯了一個錯誤。 實際上,,您應(yīng)該區(qū)分構(gòu)建GUI對象并使其可見,。 所以這是這樣做的方法: public class MainClass { final GUIClass gui = new GUIClass(); Runnable r = new Runnable() { public void run() {

鏈接到MonoTouch中的C ++本機庫(Linking to a C++ native library in MonoTouch)

你當(dāng)然可以使用C ++ api,但你需要將其包裝在C api或ObjC + btouch api中才能與之交談,。 調(diào)用C api使用PInvoke,,而C ++庫使用符號修改。 雖然從理論上講你可能會破壞錯位符號,,但這不是一個好主意,,因為修改是編譯器特定的,。 You can certainly use a C++ api, but you will need to either wrap it in a C api, or a ObjC+btouch api to be able to talk

怎樣找到mysql驅(qū)動

在百度里搜“mysql jdbc驅(qū)動下載”,注意找和你mysql版本一致的下,,不是越新越好

角ui路由器 - 如何訪問嵌套的,,命名視圖中的參數(shù),從父模板傳遞,?(Angular ui-router - how to access parameters in nested, named view, passed from the parent template?)

instanceID被聲明為一個參數(shù),,所以我們可以這樣訪問它 .controller('ViewWorklogCrtl', [ '$scope','$stateParams' function($scope , $stateParams ) { // $scope.instanceID = $stateParams.instanceID; ... 所有其他細節(jié)可以在這里找到https://github.com

Subclipse錯誤消息“存儲庫的預(yù)期格式'3';(Subclipse error message “Expected format '3' of repository; found format '5'”)

我對你發(fā)布的問題無能為力,但我建議嘗試顛覆,。 我對一些subclipse錯誤感到沮喪,,并且更加快樂。 安裝需要更多的工作,。 Eclipse顛覆項目 I can't help on your posted problem, but I would recommend trying subversive instead. I made the switch out of frustration with some subclipse bugs and have been much happier.

如何將Java 8 Stream轉(zhuǎn)換為二維數(shù)組?(How to convert a Java 8 Stream into a two dimensional array?)

如果您查看 A[] toArray(IntFunction generator) ,,您會看到它將Stream轉(zhuǎn)換為A[] ,,這是A元素的一維數(shù)組。 因此,,為了創(chuàng)建2D數(shù)組,, Stream的元素必須是數(shù)組。 因此,,如果首先將Stream的元素map到1D數(shù)組,,然后調(diào)用toArray ,則可以創(chuàng)建2D數(shù)組: Float[][] floatArray = map.entrySet() .stream() .map(key -> new Flo

在ng-class中表達表達式方法(Delegate method in expression in ng-class)

您在代碼段中的語法是正確的: ng-class='{'redDiv': mc.delegateCheckStatus(mc.STATES.down, machine.status), ...} 問題似乎存在于delegateCheckStatus函數(shù)本身,。 The syntax you have in the snippet is correct: ng-class='{'redDiv': mc.delegateCheckStatus(mc.STATES.down, machine.statu

那位朋友幫忙翻譯成英文,,附中文資料,畢業(yè)設(shè)計用

Discharge pulley 卸料滾筒 Take-up pulley 拉緊滾筒 Bend pulley 改向滾筒 Discharge snub pulley 卸料增面滾筒 Housings 軸承座 Sealing type 密封類型 Flow deviation system 分離系統(tǒng) Tripper 卸料機 Movable head 活動頭 Deviation flow car 卸料車 Pneumatic cylinder 氣缸 Hydraulic cylinder 液壓缸 Actuato

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請點擊一鍵舉報,。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多