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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,288
Gene

What are you actually trying to do?

What about using a listbox to display the results?
 

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
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
 

Nimrod

MrExcel MVP
Joined
Apr 29, 2002
Messages
6,259
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
 

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
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
 

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
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
 

Forum statistics

Threads
1,078,535
Messages
5,341,023
Members
399,410
Latest member
mgschainey

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top