Get sheet name for copy from a drop down

LannyN

New Member
Joined
Jun 19, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I am trying to automate processing a huge mailing list into manageable chunks. I have a workbook with 11 available sheets (mail routes) for copy destinations. I have dynamically build a dropdown list comprised of sheets that are "empty" and available to hold a new list segment. My problem lies in trying to convert the drop down value, which is the same as the sheet name, to make it work as follows where CpySht is the value from the drop down.

"Set SelectedRoute = ThisWorkbook.Sheets(CpySht)"

I've tried defining it as a range, concatenating it with ("" & CpySht), and a couple of other methods, but I keep getting an object variable error message.

Any ideas?

Thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
if CpySht is a string variable then
there should be no quotes in that line
If the dropdown is an actual combobox then it would be ThisWorkbook.Sheets(combobox1)
If data validateion then if would be the range of the data validation
ThisWorkbook.Sheets(range("A1").value)
 
Upvote 0

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,038
Latest member
apwr

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