ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking user has input a valid address. (https://www.excelbanter.com/excel-programming/355314-checking-user-has-input-valid-address.html)

Peter Rooney

Checking user has input a valid address.
 


Dave Peterson

Checking user has input a valid address.
 
dim teststr as string
dim testrng as range

teststr = "hi there" 'get it someway

set testrng = nothing
on error resume next
set testrng = activesheet.range(teststr)
on error goto 0

if testrng is nothing then
'it's not a range
else
'yep it is
end if


You may want to look at application.inputbox(....,type:=8), too.

Peter Rooney wrote:

--

Dave Peterson


All times are GMT +1. The time now is 01:48 PM.

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