我有一張表格,其中有來自兩個不同來源的數據。我在它們之間有一個空行。我想將此空行作爲我的分隔符。我怎樣才能知道整行是否空白。如何找出excel中整行是否空白徹底vba
12
A
回答
15
如果你談論然後字面整個行類似的代碼這應該工作(只要沒有公式或空間存在於任何細胞以及):
If Application.CountA(ActiveCell.EntireRow)=0 Then
MsgBox "Row Empty"
Exit Sub
End If
否則,的範圍內從行:
Dim neValues As Range, neFormulas As Range, MyRange As Range
Set MyRange = Columns("C:AA")
On Error Resume Next
Set neValues = Intersect(ActiveCell.EntireRow.SpecialCells(xlConstants), MyRange)
Set neFormulas = Intersect(ActiveCell.EntireRow.SpecialCells(xlFormulas), MyRange)
On Error GoTo 0
If neValues Is Nothing And neFormulas Is Nothing Then
MsgBox "Nothing There"
Else
MsgBox "Something's There"
End If
(來源:http://www.ozgrid.com/forum/showthread.php?t=26509&page=1)
8
WorksheetFunction.CountA()
,如下面所示:
Dim row As Range
Dim sheet As Worksheet
Set sheet = ActiveSheet
For i = 1 To sheet.UsedRange.Rows.Count
Set row = sheet.Rows(i)
If WorksheetFunction.CountA(row) = 0 Then
MsgBox "row " & i & " is empty"
End If
Next i
相關問題
- 1. Excel VBA排序範圍,空白和空值在範圍底部
- 2. vba excel如何檢查單元格是否爲空並着色整行?
- 3. 如何徹底刪除重複的行
- 4. Excel VBA導出爲文本文件。需要刪除空白行
- 5. surefire如何徹底關機?
- 6. Excel VBA中 - 基於空白另一列
- 7. 刪除空白(空)列Excel VBA
- 8. 查找空白項指數中的二維數組的Excel VBA
- 9. 檢查數組是否爲空(vba excel)
- 10. 從SQL導出到excel的空白行
- 11. 在VBA中查找Excel工作底部的底部
- 12. 刪除行如果列K:R全包含空白VBA的Excel
- 13. 在Groovy中徹底地行走AST樹
- 14. Excel VBA條件格式化行中的空白單元格
- 15. 如何從細胞空行在Excel(VBA)
- 16. VBA Excel - > PWP - 複製時空白
- 17. 如何在Python中啓用seccomp後徹底退出?
- 18. MsgBox是/否Excel VBA
- 19. Excel VBA:如果發現空白單元格,如何退出循環
- 20. Excel vba如何確定.usedrange是否爲空
- 21. 徹底和徹底搞砸了svn回購 - 如何開始新鮮
- 22. 徹底理解linq
- 23. 獲取整行excel vba
- 24. 如何在Excel VBA中將整數設置爲空?
- 25. 空白底部Firefox
- 26. Excel VBA - 如何檢查隱藏範圍內的非空白值
- 27. 我如何徹底刪除Django註冊?
- 28. 我如何徹底刪除root密碼
- 29. 如何徹底卸載Visual Studio 2010?
- 30. 如何徹底測試發佈版本?