Consulting

Results 1 to 3 of 3

Thread: Solved: Select Cooresponding Cell Fron Listbox

  1. #1
    VBAX Regular
    Joined
    May 2011
    Posts
    46
    Location

    Solved: Select Cooresponding Cell Fron Listbox

    Hello all,

    the following code selects the selected corresponding cell from the listbox.
    [VBA]If ListBox1.ListIndex > -1 Then Cells(ListBox1.ListIndex + 1, 13).Select[/VBA]

    However the cells are on another sheet than the listbox.
    What do I need to do?

  2. #2
    VBAX Regular
    Joined
    Aug 2011
    Posts
    11
    Location
    Try the following:

    [VBA]
    If ListBox1.ListIndex > -1 Then

    Application.Goto ActiveWorkbook.Sheets("Sheet2").Cells(ListBox1.ListIndex + 1, 13)
    [/VBA]

    Replace "Sheet2" with the location of the cells you wish to select

  3. #3
    VBAX Regular
    Joined
    May 2011
    Posts
    46
    Location
    Thanks JWest, it worked!

Posting Permissions

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