LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Multiples

If you multipled don't get to be too many:

Sub ShowMults()
Dim x As Long
Dim textNum As Long
TestNum = 10 ^ 5
Results = ""
For x = 1 To TestNum
If TestNum Mod x = 0 Then
Foundcount = Foundcount + 1
If Foundcount 1 Then Results = _
Results & ", " & x Else: Results = x
End If
Next x
varr = Evaluate("{" & Results & "}")
Cells(1, 1).Resize(UBound(varr) - _
LBound(varr) + 1, 1) = _
Application.Transpose(varr)

End Sub

--
Regards,
Tom Ogilvy

wrote in message
om...
Thanks. I used Gregs code originally because it was simpler for me to
understand. However I ran into another issue. I need to print the
multiple list in a sheet and I need each multiple in its own cell. I
know how to do this if the results are in a array. But the code in
Gregs example basically builds a moving text string with commas i.e.

1, 2, 3, 4, 6, 9, 12, 18, 36

How do I dump this text string into cells so that it look like this
(i.e. separate the numbers and remover the commas:

1
2
3
4
6
9
12
18
36

Thanks again.

TS



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested IFs and multiples Karl Excel Worksheet Functions 7 September 3rd 09 03:21 PM
DISPLAY IN MULTIPLES Faraz A. Qureshi Excel Discussion (Misc queries) 1 August 7th 09 09:47 AM
Displaying multiples of 10 Sheeloo[_3_] Excel Discussion (Misc queries) 0 February 7th 09 04:35 AM
lookup multiples need help Excel Worksheet Functions 2 July 25th 07 07:38 PM
Multiples of 4 in an IF statement Barry Clark Excel Worksheet Functions 3 August 22nd 06 01:22 PM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"