Juggler_IN
Active Member
- Joined
- Nov 19, 2014
- Messages
- 358
- Office Version
- 2003 or older
- Platform
- Windows
I need help to output the outcome to a Sheet instead of Immediate Window ... code from one of my posts at IntPartitions.
VBA Code:
Sub demo()
printPartitions 4, 4, ""
End Sub
Function printPartitions(tgt As Long, max As Long, sfx As String) As String
If tgt = 0 Then
Debug.Print sfx
Else
If max > 1 Then printPartitions tgt, max - 1, sfx
If max <= tgt Then printPartitions tgt - max, max, max & " " & sfx
End If
End Function