Can a "result scroller" be made?

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
From what I gather, tools such as scroll bars and spin buttons are for USER input. What if the input is a number and the RESULT are the factors of the number. You don't know how many factors there are until the user inputs the choice. Therefore, the results may be bigger than the size of whatever you are putting them into. Is there are way to put the results into a textbox (or whatever) that has the ability to scroll?

Gene, "The Mortgage Man", Klein
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Gene

What are you actually trying to do?

What about using a listbox to display the results?
 
Upvote 0
I'm actually trying to display the factors of a number. Until the user enters the number the number of factors is unknown.

I thought a listbox was for user entry, not for results. Do I have to do something special to use it for results? Will it add the up and down arrows if the results are bigger than the box, or must I do that somehow?

Gene, "The Mortgage Man", Klein
 
Upvote 0
Code:
Private Sub cmdGetFactors_Click()

TheNum = Me.txtNumberEntered

If IsNumeric(TheNum) Then
    For Num = 1 To TheNum
        If TheNum Mod Num = 0 Then
            With Me.ListBox1
           .AddItem Num, .ListIndex
           End With
        End If
    Next Num
End If
End Sub
 
Upvote 0
Nimrod - way more than I asked, but of course Thanks!

Two questions. Is there any way to supress the horizontal left and right arrows from the listbox?

What is the purpose of adding the ListIndex (as it doesn't seem to show up in the listobox itself)

Gene, "The Mortgage Man", Klein
 
Upvote 0
One more question

Upon testing I realized that I needed this: How do you remove ALL the items from a list box? I have to clean out the list box if the user tries to get the factors of another number.

Gene, "The Mortgage Man", Klein
 
Upvote 0

Forum statistics

Threads
1,214,899
Messages
6,122,155
Members
449,068
Latest member
shiz11713

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top