Thanks so much! This is perfect!
Thanks so much! This is perfect!
Last edited by shg; 01-19-2011 at 11:09 AM. Reason: deleted spurious quote
Actually, errata and improvements.
You can list the numbers 99 to 99000 stepping by 9: 99, 108, 117, ...
Then autofilter, and 4840 numbers survive (I was doing this in Excel 2003, so couldn't list all the numbers stepping by one).
Please don't quote whole posts.
Entia non sunt multiplicanda sine necessitate
Brute force approach:
![]()
Sub List18s() Dim a As Long, b As Long, c As Long, d As Long, e As Long Dim lngCount As Long Dim varOut() ReDim varOut(1 To 99000) For a = 0 To 9 For b = 0 To 9 For c = 0 To 9 For d = 0 To 9 For e = 0 To 9 If a + b + c + d + e = 18 Then lngCount = lngCount + 1 varOut(lngCount) = CLng(a & b & c & d & e) End If Next e Next d Next c Next b Next a ReDim Preserve varOut(1 To lngCount) Range("A1").Resize(lngCount).Value = Application.Transpose(varOut) End Sub
Everyone who confuses correlation and causation ends up dead.
Sure, let your COMPUTER do all the work. Lazy slug.
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks