![]() |
determinate if a range is empty
I want find with macro if a range of cells is empty or has at least one
value (Example: range("A5:c30") ) |
determinate if a range is empty
Here is one way to do it, if you only need to know if all cells in the
rangfe are empty or at least one cell is not enmpty: Sub EmptyRange() For Each c In ActiveWorkbook.ActiveSheet.Range("a5:c30").Cells If Not IsEmpty(c) Then MsgBox "At least one cell: " & c.Address & " in the range contains data", vbonkonly + vbInformation Exit Sub End If Next c MsgBox "All cells within range are empty", vbOKOnly + vbInformation End Sub Jan "GUS" skrev i en meddelelse ... I want find with macro if a range of cells is empty or has at least one value (Example: range("A5:c30") ) |
determinate if a range is empty
Save hard processing!
If WorksheetFunction.CountA(Plan1.Range("A5:C30")) = Empty Then .... End If "GUS" escreveu na mensagem ... I want find with macro if a range of cells is empty or has at least one value (Example: range("A5:c30") ) --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.528 / Virus Database: 324 - Release Date: 16/10/2003 |
All times are GMT +1. The time now is 05:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com