My worksheet has a series of rows & corresponding columns, let's call them 'Options". Envision 20 options exist, so there's....
- 20 option columns, then
- 20 option rows
.... these are all in sequential order no spaces.
Worksheet users can manage display of these options via a simple userform where they input a start/end range to display.
Today I do this with absolute cell positions, BUT the options move around on sheet. Can anyone help me with approach or syntax to reference the positions dynamically? I have a few ideas, but can't get the code right. Was trying named ranges but can't figure out syntax using those. I'm open to any approach that works.
Here's a snippet of what I do now.
I understand compensation is a no-no but if it's allowed I'll happily donate $20 to my local animal shelter for a working result
- 20 option columns, then
- 20 option rows
.... these are all in sequential order no spaces.
Worksheet users can manage display of these options via a simple userform where they input a start/end range to display.
Today I do this with absolute cell positions, BUT the options move around on sheet. Can anyone help me with approach or syntax to reference the positions dynamically? I have a few ideas, but can't get the code right. Was trying named ranges but can't figure out syntax using those. I'm open to any approach that works.
Here's a snippet of what I do now.
VBA Code:
Dim Ostart As String
Dim Oend As String
'Assign userform inputs to those....
Ostart = USERFORM.TextBox1.Text
Oend = USERFORM.TextBox2.Text
'some code to hide all of 1-25, nothing special
'The section I'm struggling with is this --- need to get away from the exact positions
Range(Cells(1, 19 + Ostart), Cells(1, 19 + Oend)).EntireColumn.Hidden = False
Range(Cells(19 + Ostart, 1), Cells(19 + Oend, 1)).EntireRow.Hidden = False
I understand compensation is a no-no but if it's allowed I'll happily donate $20 to my local animal shelter for a working result