Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If [Block1] is more than a few lines, I would put its code in a subroutine
and then call that subroutine from this code... ...... ...... If TypeOf Z Is Range Then If Z.Cells.Count 1 Then [Block 2] Else Call Block1 End If Else Call Block1 End If ....... ....... End Sub|Function Sub Block1() <<code End Sub Include an appropriate argument list if the Block1 subroutine is dependent on local variables. Rick "Dietmar M. Kehrmann" wrote in message ... But I need If TypeOf Z Is Range Then If Z.Cells.Count 1 Then [Block 2] Else [Block 1] End If Else [Block 1] End If and then [Block 1] appears two times. Ugly ^^ |
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 |