Is it possible to have excel dynamic select cells? I'd love to know how to make a macro that does that. I want it to select certain cells based on the value of other cells. For example, ik want to select A1 to A20. And ik want to do that by simply typing 1 in a cell and 20 in another.
I tried this code in vba
Dim example as range Set example = range ("A1:A20")
Example. Select.
It works, but i want the A1 and A20 to be changeable so i can select different ranges
Is that possible? And if not, what is the closest thing to it? Many thanks!
I assume start row is in B1 and end row is in B2.
It sounds like you should have two cells in that sheet that are your controls. So you would put "A1" in one cell as the starting cell, and "A20" as the ending cell in another. Let's just put them in C1 and D1 respectively.
If you want the values in C1 and D1 to be dynamic, you would have to put a formula in there to do that. If you're ok with it being changed manually, I would just highlight them a different color to call attention to the macro dependency.