I have a list box with multiple selections. As I iterate through it, it changes the value of a cell if an item is selected. However, if I select the cell first, it erases all of my subsequent selections and I only get the results of the first selection.
It seems pretty simple. There's got to be a way to do it, I just don't know it.
|Check out our Excel VBA Resources|
Use something like this
Range("test").Value = 5
where your named range is named "test" and you want that range's value to be 5 (in each cell of the range).
Does this help you?
This worked fine. This was my original idea, but it didn't seem to work. I was try to use RefersToRange property of "Names" because I'd had problems with a named range before. When do I have to use RefersToRange to for a name and when don't I?
Thanks for your help! I'm having a lot of fun learning this language, but it's hard when you run into a stumbling block. This board has helped me a lot.
"Returns the Range object referred to by a Name object. Read-only."
This could be useful, for example, if you wanted to get a named range's address in VBA. Something like:
Dim RangeAddress As String
RangeAddress = Names("Melanie").RefersTo