Consulting

Results 1 to 2 of 2

Thread: Call value from worksheet

  1. #1

    Call value from worksheet

    Hello,
    can anyone tell me how I can work with a value in VBA that is stored in an excel spreasheet?

    I want to make an If loop stating that:
    [VBA]
    If value_in_"User Data!A" & Listbox1.Listindex + 3 = 0 then
    Label1.Caption = "User Data!A" & Listbox1.Listindex + 1
    End If
    [/VBA]

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    [vba]
    If value_in_"User Data!A" & Listbox1.Listindex + 3 = 0 then
    [/vba]

    Maybe I am misreading this, but I do not think so. The value returned by .ListIndex should be -1 to one less that the list count. So as -1 + 3 is already 2......

Posting Permissions

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