Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone help me simplify the following function? The object references
seem too complicated (eg ActiveSheet.Range(area1.Address).Cells ) and I can't get the output bit to work. Any ideas? Thanks Damien Public Function CrossJoin(area1 As Range, area2 As Range, Optional output_range) 'Cartesian Join two areas 'On Error GoTo CrossJoin_Err Dim cll1 Dim cll2 Dim i As Long For Each cll1 In ActiveSheet.Range(area1.Address).Cells For Each cll2 In ActiveSheet.Range(area2.Address).Cells Debug.Print cll1, cll2 If Not IsMissing(output_range) Then '!!TODO ActiveSheet.Range(output_range.Address).Value = cll1.Value End If i = i + 1 Next Next CrossJoin = i CrossJoin_Exit: Exit Function CrossJoin_Err: MsgBox Err & ", " & Err.Description Resume CrossJoin_Exit End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom function to simplify Index(match)) formula | Excel Discussion (Misc queries) | |||
Help me simplify this function.... | Excel Worksheet Functions | |||
simplify a vlookup function | Excel Worksheet Functions | |||
simplify function | Excel Worksheet Functions | |||
Simplify Vlookup function in Excel | Excel Worksheet Functions |