ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   if emthy (https://www.excelbanter.com/excel-programming/323328-if-emthy.html)

Alvin Hansen[_2_]

if emthy
 
Hi!!

I have this in a userform
Set myrange2 =
Sheets(Range("kurt!$i$1").Value).Range(Range("kurt !$i$1").Value)

Can i do something if the range is emthy

regards alvin

Alvin Hansen[_2_]

if emthy
 
Have done it again

Alvin


"Alvin Hansen" skrev:

Hi!!

I have this in a userform
Set myrange2 =
Sheets(Range("kurt!$i$1").Value).Range(Range("kurt !$i$1").Value)

Can i do something if the range is emthy

regards alvin


Tushar Mehta

if emthy
 
Depending on what you mean by empty

on error resume next
set myrange2=nothing
Set myrange2 = _
Sheets(Range("kurt!$i$1").Value).Range(Range("kurt !$i$1").Value)
on error goto 0
if myrange2 is nothing then
'do stuff is nothing
end if

Or, you may want to look up VBA for the IsEmpty function.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hi!!

I have this in a userform
Set myrange2 =
Sheets(Range("kurt!$i$1").Value).Range(Range("kurt !$i$1").Value)

Can i do something if the range is emthy

regards alvin


Alvin Hansen[_2_]

if emthy
 
Thanks for the help

Alvin


"Tushar Mehta" skrev:

Depending on what you mean by empty

on error resume next
set myrange2=nothing
Set myrange2 = _
Sheets(Range("kurt!$i$1").Value).Range(Range("kurt !$i$1").Value)
on error goto 0
if myrange2 is nothing then
'do stuff is nothing
end if

Or, you may want to look up VBA for the IsEmpty function.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hi!!

I have this in a userform
Set myrange2 =
Sheets(Range("kurt!$i$1").Value).Range(Range("kurt !$i$1").Value)

Can i do something if the range is emthy

regards alvin




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

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