Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have to do different things ([BLOCK 1] and [BLOCK 2]) if Z is a "Single" (a number or a Range of 1x1) or if Z is a Range (a genuine, not 1x1). My workaround is like If TypeOf Z Is Range Then If (Z.Rows.Count=1) And (Z.Columns.Count=1) Then [Block 1] Else [Block 2] End If Else [Block 1] End If but I don't like it: [Block 1] two times and the construction '(Z.Rows.Count=1) And (Z.Columns.Count=1)' seems to be ugly. I guess that this problem appears frequently. What would be a good solution? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to distinguish zeros ("0") from blank cells? | Excel Worksheet Functions | |||
Multiple "source" workbooks linked to single "destination" workboo | Excel Worksheet Functions | |||
Change data in a single column from "last, first" to "first last" | Excel Discussion (Misc queries) | |||
Copy column range of "single word" cells with spaces to a single c | Excel Discussion (Misc queries) | |||
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" | Excel Programming |