ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking range of cells for entry then checking for total (https://www.excelbanter.com/excel-programming/375059-checking-range-cells-entry-then-checking-total.html)

Barb Reinhardt

Checking range of cells for entry then checking for total
 
I have a range of cells named "Reuse_Estimate" (B22:B24 in my worksheet) that
need to have something entered in all cells. Once a value is entered in all
cells, I need to check that the range named "Reuse_Total" is a specific
value. I have the code for the latter, but am not sure how to check that the
Reuse_Estimate ranges are not blank. Any suggestions?

Thanks

Ron de Bruin

Checking range of cells for entry then checking for total
 
Hi Barb

You can use the counta function

Sub test()
If Application.WorksheetFunction.CountA(Range("Reuse_ Estimate")) = 3 Then
'Do nothing
Else
MsgBox "Please fill in all cells"
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Barb Reinhardt" wrote in message
...
I have a range of cells named "Reuse_Estimate" (B22:B24 in my worksheet) that
need to have something entered in all cells. Once a value is entered in all
cells, I need to check that the range named "Reuse_Total" is a specific
value. I have the code for the latter, but am not sure how to check that the
Reuse_Estimate ranges are not blank. Any suggestions?

Thanks





All times are GMT +1. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com