Is there any way to create named ranges with VBA using row& column indexes, say create a named range where start row number us stored in myRow and end row number in endRow and similarly for columns myCol and endCol?
What exactly i need is that i have a column of data(some are repeating) whose start and end row value is stored in variables , now i want to add this data to drop down using named range and also i need to avoid duplicate entries. The length of data exceeds 255 characters so i must use named range..Can anyone help??
Use the Advanced Filter feature to filter your column for just the Unique entries. Copy those unique values from the filtered column to an empty column. The link gives you some very good example code to do that.
Use the new column of unique entries as the reference in your data validation drop down list. Or redefine your named range to the column of unique entries.
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.