+ Reply to Thread
Results 1 to 5 of 5

select range as in the first range without using scroll bar based on combobox on form

  1. #1
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    262

    select range as in the first range without using scroll bar based on combobox on form

    Hello
    I have many ranges in H:L . the combobox is matched with names when I select the name from combobox1 I would search for the name in column I then the range should show as is in first range without using scroll bar to see the range is selected by combobox where is it .
    as in the picture should move the range above when select name in combobox and populate the TOTAL row in textbox1.2.3.4.
    thanks
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Ali-M; 07-08-2023 at 04:57 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: select range as in the first range without using scroll bar based on combobox on fo

    Try this, I assumed it was going in your command button

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    262

    Re: select range as in the first range without using scroll bar based on combobox on fo

    thanks ,but the most important should move the range as if it is in first range when I select name from combobox. I don't want using scrollbar to see the range if I have multiple ranges.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hello, try this !


    According to your attachment a starter VBA procedure to paste only to the UserForm1 module :

    PHP Code: 
    Private Sub CommandButton1_Click()
            
    Dim Rf As RangeR&, C%
            If 
    ComboBox1 "" Then Beep: Exit Sub
        With ActiveSheet
    .UsedRange.Columns(9)
            
    Set Rf = .Find(ComboBox1, , xlValues1)
         If 
    Not Rf Is Nothing Then
            R 
    Rf.Row
         
    Do
             If 
    Rf.Row 1 Then
                
    If Rf(0) = "NAME" Then
                    Windows
    (1).ScrollColumn 8:  Windows(1).ScrollRow Rf.Row
                    Set Rf 
    Rf.End(xlDown)
                    For 
    1 To 4:  Controls("Textbox" C) = Rf(1C).Text:  Next
                    
    Exit Do
                
    End If
             
    End If
            
    Set Rf = .FindNext(Rf)
         
    Loop Until Rf.Row R
            Set Rf 
    Nothing
         End 
    If
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  5. #5
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    262

    Re: select range as in the first range without using scroll bar based on combobox on fo

    Excellent Marc !
    this is exactly what I want it .
    thank you so much .

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. copy data from form to specific range based on selection combobox
    By tubrak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2021, 07:02 AM
  2. Replies: 2
    Last Post: 07-20-2018, 12:35 AM
  3. [SOLVED] populate user form combobox based on dynamic range
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2015, 09:22 PM
  4. [SOLVED] How to Select Worksheet and Cell/range based on ComboBox Values
    By ckarlest in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2014, 10:54 AM
  5. [SOLVED] Select Range based on COmboBox selections
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2013, 11:24 PM
  6. Code to select range and open a user form is opening the wrong range
    By rrbest in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2010, 12:34 PM
  7. copy range when I select a value in a combobox
    By iscar_marius in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-08-2009, 09:14 AM

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