Consulting

Results 1 to 3 of 3

Thread: Solved: Use a spreadsheet specifies interval even if another is active

  1. #1
    VBAX Tutor
    Joined
    Jan 2011
    Posts
    272
    Location

    Solved: Use a spreadsheet specifies interval even if another is active

    Hi.

    I need to take breaks
    ComboBox1.RowSource = Worksheets ("Sheet2"). Range ("Table1"). Address

    with the tab "Sheet1" I've been active, but the code below to select the tab "Sheet1" to ComboBox1, takes values ​​tab "Sheet1" and I pointed out that it is in line to pick up the tab interval "Sheet2"
    [VBA]Private Sub UserForm_Initialize()
    With Sheet2
    ComboBox1.RowSource = Worksheets("Sheet2").Range("Table1").Address
    ComboBox2.RowSource = Worksheets("Sheet2").Range("Table2").Address
    End With
    End Sub[/VBA]
    Thank you!!

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    [vba] ComboBox1.RowSource = Worksheets("Sheet2").Range("Table1").Address(external:=True)
    ComboBox2.RowSource = Worksheets("Sheet2").Range("Table2").Address(external:=True)
    [/vba]
    or:[VBA] ComboBox1.List = Application.Transpose(Worksheets("Sheet2").Range("Table1"))
    ComboBox2.List = Application.Transpose(Worksheets("Sheet2").Range("Table2"))
    [/VBA]
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Tutor
    Joined
    Jan 2011
    Posts
    272
    Location
    Hi

    Yes!!!

    Thank you!!!

Posting Permissions

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