listbox

miiia83

Board Regular
Joined
Feb 28, 2007
Messages
83
hej!

vet nån hur koden för att skapa en listbox ser ut??
jag har en kod i excel VB som ser ut som nedan.. jag skulle vilja att function_codes visades som en listbox men vet inte hur jag skall göra det??!!

Code:
Sub Get_Category()

    resrow = 3     'börjar vid cell 3,2
    rescol = 2
    Sheets("sheet1").Range("b2:j1000").ClearContents
    

    OpenConnection ("RFC")
   
    strQuery = "SELECT * FROM DESCRIPTIONS"   'DESCRIPTIONS = tabellnamn
    Set rs = ConnRFC.Execute(strQuery)
    Do Until rs.EOF
        Sheets("sheet1").Cells(resrow, rescol).Value = rs("FUNCTION_CODE")
        Sheets("sheet1").Cells(resrow, rescol + 1).Value = rs("DESCRIPTION")
        
        resrow = resrow + 1
        rs.MoveNext
    Loop
    
    KillConnection ("RFC")


End Sub
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,223,959
Messages
6,175,649
Members
452,663
Latest member
MEMEH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top