+ Reply to Thread
Results 1 to 8 of 8

Sort Rows With Linked Textboxes

Hybrid View

Lord Raiden Sort Rows With Linked... 01-09-2008, 02:14 PM
shg Why do you need text boxes? 01-09-2008, 03:19 PM
Lord Raiden To allow a unified row size... 01-09-2008, 04:04 PM
shg That's a well-considered... 01-09-2008, 04:37 PM
Lord Raiden Solved 01-10-2008, 02:33 PM
shg Well done, thanks for posting... 01-10-2008, 03:06 PM
shg This line If Not... 01-10-2008, 03:12 PM
Lord Raiden Good point. Thanks. 01-10-2008, 04:21 PM
  1. #1
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Why do you need text boxes?

  2. #2
    Registered User
    Join Date
    01-09-2008
    Posts
    4
    Quote Originally Posted by shg
    Why do you need text boxes?
    To allow a unified row size regardless of the amount of text in a specific description. Because cells cannot embed a scroll bar, the text boxes allow me to display the information using scroll bars. Linking it to a cell allows for easier input.

    Then end result is our display is nicer. If there is no work-a-round I will either remove the text boxes and turn off Autofit for the row height or remove the link to a cell and require entering data straight in to the text box.

    Nevertheless, if there is a work-a-round I would like to discover it. Not only for my current use but because I'd now like to know exactly what the limitation of this usage is, just for the sake of knowing.

    Muchas Gracias!

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    That's a well-considered reason. Alas, I have no suggestion, but if you find a workable one elsewhere, drop back and let us know.

  4. #4
    Registered User
    Join Date
    01-09-2008
    Posts
    4

    Cool Solved

    Quote Originally Posted by shg
    That's a well-considered reason. Alas, I have no suggestion, but if you find a workable one elsewhere, drop back and let us know.
    Here is my solution based on feedback I found:

    ' col is the column the boxes are in, colOffset is the offset from where the text is
    Sub UpdateSortedBoxes(col As String, colOffset As Integer)
    
        Dim TB As OLEObject
    
        For Each TB In Application.ActiveSheet.OLEObjects
            If TB.Name Like "TextBox*" Then
                If Not Intersect(Range(col & ":" & col), TB.TopLeftCell) Is Nothing Then
                    TB.LinkedCell = TB.TopLeftCell.Offset(0, colOffset).Address
                End If
            End If
        Next
       
    End Sub

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Well done, thanks for posting back.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    This line
    If Not Intersect(Range(col & ":" & col), TB.TopLeftCell) Is Nothing Then
    simplifies to
    If TB.TopLeftCell.Column = col Then

  7. #7
    Registered User
    Join Date
    01-09-2008
    Posts
    4

    Smile

    Quote Originally Posted by shg
    This line
    If Not Intersect(Range(col & ":" & col), TB.TopLeftCell) Is Nothing Then
    simplifies to
    If TB.TopLeftCell.Column = col Then
    Good point. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1