Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
Is it possible to "build" a range?
I have a column of cells with values in them (H9:H42).
I set ranges using a series of contingent cells in that range. These set ranges become the source of my named ranges which I use as data validation list sources.
Both rng_biscuits and rng_flowers may become the source range for a named range used in a list data validation.
Suppose I want my data validation list to be a combination of both ranges H9:H12 and H30:H42?
I tried
\
But the list included all the values between H9:H42 in my data validation list. (I do not need values from H13:H29).
I have a column of cells with values in them (H9:H42).
I set ranges using a series of contingent cells in that range. These set ranges become the source of my named ranges which I use as data validation list sources.
Code:
Dim rng_biscuits as range
Dim rng_flowers as range
Dim combined as range
Set rng_biscuits = worksheets(sheet1).range("H9:H12")
Set rng_flowers = worksheets(sheet1).range("H30:H42")
Both rng_biscuits and rng_flowers may become the source range for a named range used in a list data validation.
Suppose I want my data validation list to be a combination of both ranges H9:H12 and H30:H42?
I tried
Code:
set combined = worksheets(sheet1).range("H9:H12,H30:H42")
But the list included all the values between H9:H42 in my data validation list. (I do not need values from H13:H29).