how to retrieved my data in worksheet to my combo box ??

Jefferson2512

Board Regular
Joined
Sep 16, 2019
Messages
53
i call pesat to my button

Code:
Private Sub pesat()
    
    Dim wks As Worksheet
    Set wks = Sheet9
        pesatcb.Text = wks.Range("BH3").Value


 
End Sub
Code:
Private Sub pesatcb_Change()
    Dim wks As Worksheet
    Dim addnew As Range
    Set wks = Sheet9
     
    
    Set addnew = wks.Range("CV3").Offset(0, 0)
   
        addnew.Offset(0, 0).Value = pesatcb.Text
End Sub
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
In the first code you have an ActiveX combo box and you assign to it the value in BH3.
In the second code you assign the value in the combo box to CV3
I assume by your title you want to add worksheet data to the combo box drop down list. This may help:

Code:
Sub PopulateComboBoxDropDownList()

    Dim aryDD As Variant
    Dim lIndex As Long
    
    ReDim aryDD(1 To 5)
    For lIndex = 1 To 5
        aryDD(lIndex) = Range("A" & lIndex).Value
    Next
    
    Worksheets("Sheet1").ComboBox1.List = aryDD
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,530
Members
448,969
Latest member
mirek8991

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