Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Nested IFs and multiples | Excel Worksheet Functions | |||
DISPLAY IN MULTIPLES | Excel Discussion (Misc queries) | |||
Displaying multiples of 10 | Excel Discussion (Misc queries) | |||
lookup multiples | Excel Worksheet Functions | |||
Multiples of 4 in an IF statement | Excel Worksheet Functions |