Error while reading value of combobox - Run time error 424 : Object Required

acmehra

New Member
Joined
Jan 20, 2018
Messages
16
Hi Friends ,

I am trying to put the value selected in combobox in a variable but its showing Run Time error 424 - Object Required .

Here is my code :

HTML:
Dim dd_val As String
Dim Data_sht As Worksheet
  dd_val = DD_Sell.Value
  Set Data_sht = ThisWorkbook.Worksheets(dd_val)

I tried using

HTML:
dd_val = .List(.value)

But it also doesn't work .

NOTE : DD_Sell is the name I have for combobox in Formula bar of excel. In my excel file , this combobox is having list of the names of different sheets in my excel file.

Please help.
 
Last edited:
Where do you get the error and where is the combobox located?
 
Upvote 0
Where do you get the error and where is the combobox located?

Combobox is on the same sheet where pivot is being built. Sheet name is "Reports".
I get error while selecting any value from the combobox list. I tried using

Code:
dd_val = reports.DD_Sell.value

but its also not working
 
Last edited:
Upvote 0
Hi All,

I found the issue. Below was the reason. I had added below code to correct the error :
Code:
Sub ChangeSellDataSource()


With ActiveSheet.Shapes("DD_Sell").ControlFormat




   dd_val = .List(.ListIndex)
   
  Set Data_sht = ThisWorkbook.Worksheets(dd_val)
  Set Pivot_sht = ThisWorkbook.Worksheets("reports")
End With
End SUB
 
Upvote 0

Forum statistics

Threads
1,226,771
Messages
6,192,918
Members
453,766
Latest member
Gskier

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