De: John Walkenbach Objet: Re: range.IsEmpty Date : lundi 23 août 1999 17:44 Here's a function procedure that accepts a range argument. It returns true if the range is empty. function rangeisEmpty(r As range) As Boolean if application.counta(r) = 0 then _ rangeisEmpty = true Else rangeisEmpty = false end function Here's a sub procedure to test the rangeIsEmpty function: Sub test() dim Myrange As range set Myrange = range("A1:C50") msgbox rangeisEmpty(Myrange) end Sub ----- Posted by John Walkenbach of JWalk & Associates ----- ----- NOW AVAILABLE: PUP 2000 FOR EXCEL ----- ----- http://www.j-walk.com/ss ----- Eivind Bakkestuen wrote in message news:37C16D97.D7E2FE2A@maestrosoft.no... > Is there an easy way to check if a chosen range is empty (no cells with > vaules)? I'm trying to automate the Excel TexttoColumns dialog, and I > need to check if there is any data at all selected (if not, Excel > displays an error dialog that I don't want the user to see).