+ Reply to Thread
Results 1 to 4 of 4

ControlFormat scrolling to first item

  1. #1
    Registered User
    Join Date
    02-26-2015
    Location
    Portugal
    MS-Off Ver
    XP professional
    Posts
    2

    ControlFormat scrolling to first item

    Hi everyone,
    I'very, very new around.

    I'me sure this topic has already been discussed, if so, can you redirect me?

    very simple, but don't seem to find the answer:

    I've got a listbox1 in worksheet1
    I want it to show the firts item using VBA
    (selected ? item ? Index ? )
    can't make it work.

    Thank you

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: ControlFormat scrolling to first item

    Hi,

    What kind of listbox is it- ActiveX or Form control?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: ControlFormat scrolling to first item

    Hi, and welcome to the forum.

    Please upload the workbook and explain which item you expect to see in the list box.
    Then what do you expect? I sense that you want to move to that first item, but in which case what's the point of displaying it in a listbox? Why not save yourself a step and just have a macro attached to a button which when clicked takes you to the first item?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    02-26-2015
    Location
    Portugal
    MS-Off Ver
    XP professional
    Posts
    2

    Re: ControlFormat scrolling to first item

    Thank you for quick reply.

    It's an ActiveX.

    I've finaly found the answer.
    If i put the index value to zero and then select the firts item, listbox will unselect all item, srcoll to top and show first item selected.
    It wasn't so obvious at firts and i was struggling to get it right.

    ActiveSheet.Shapes("Caixa de listagem 1").ControlFormat.ListIndex = 0
    ActiveSheet.Shapes("Caixa de listagem 1").ControlFormat.ListIndex = 1

+ 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. UserForm: Search Item in List > Call Table associated with Item > Execute Command
    By TexasAggie12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2014, 12:58 PM
  2. [SOLVED] Scrolling listbox to show last entered item
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-11-2012, 09:33 AM
  3. scrolling through listbox item's with button's
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-04-2009, 04:45 AM
  4. [SOLVED] ThisWorkbook.Saved = True does not work when Shapes().ControlFormat.Enabled = False
    By Joe HM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2006, 02:50 PM
  5. Replies: 2
    Last Post: 07-20-2006, 08:25 PM
  6. Replies: 10
    Last Post: 07-14-2006, 10:10 AM
  7. Replies: 0
    Last Post: 05-11-2006, 10:20 PM

Tags for this Thread

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