Associate
I've got a problem I've been working on for quite a long while, and I've been trying to write something like the following asking for help for about as long It's difficult for me to explain. So if you'r good with VBA and patient enough to read what I've done below I'd really appreciate any help you can give
In my worksheet there are several sets of ranges.
Each one of these ranges is 1 Column wide and a dynamic number of Rows.
The ranges have nothing to do with each other (so its values are only relevant to itself)
Each range has a unique number, and the values of the range are Group Names.
There can (will) be multiple instances of a group name, and there is no limit to the number of groups that can be in a range.
Each cell in the range will either have a group name or be Empty
I have a function that reads through the source sheet and copies relevant data into a new sheet (called Groupings).
The new sheet has 3 columns, Range Number, Group Name, and Cell Address.
-Range number is the unique number of the range
-Group name is the value from the range
-Cell Address is the address of the cell inside the range.
An example of the Groupings sheet:
1 G1 $A$1
1 G2 $A$2
1 G1 $A$3
1 G1 $A$4
1 G2 $A$5
I need a function that will draw a line connecting each group name togeather (like in the picture)
Drawing the line is not the main issue (as I have a function that can do this already)
What I cant figure out how to do is make the function draw the lines in available space, instead of just moving further across.
Looking at the picture, you can see that the TW2 Group's line could fit in the first column without collision, and then TW3's line could move across into its place.
Can anyone think of a way to accomplish this?
I can provide examples of the code I have, but its not exactly pretty.
In my worksheet there are several sets of ranges.
Each one of these ranges is 1 Column wide and a dynamic number of Rows.
The ranges have nothing to do with each other (so its values are only relevant to itself)
Each range has a unique number, and the values of the range are Group Names.
There can (will) be multiple instances of a group name, and there is no limit to the number of groups that can be in a range.
Each cell in the range will either have a group name or be Empty
I have a function that reads through the source sheet and copies relevant data into a new sheet (called Groupings).
The new sheet has 3 columns, Range Number, Group Name, and Cell Address.
-Range number is the unique number of the range
-Group name is the value from the range
-Cell Address is the address of the cell inside the range.
An example of the Groupings sheet:
1 G1 $A$1
1 G2 $A$2
1 G1 $A$3
1 G1 $A$4
1 G2 $A$5
I need a function that will draw a line connecting each group name togeather (like in the picture)
Drawing the line is not the main issue (as I have a function that can do this already)
What I cant figure out how to do is make the function draw the lines in available space, instead of just moving further across.
Looking at the picture, you can see that the TW2 Group's line could fit in the first column without collision, and then TW3's line could move across into its place.
Can anyone think of a way to accomplish this?
I can provide examples of the code I have, but its not exactly pretty.