K
keyser_Soze
I have the following macro which bounces me back and forth between b:k
and m:u
Private Sub Workbook_SheetBeforeDoubleClick( _
ByVal Sh As Object, ByVal target As Range, Cancel As Boolean)
If Not Intersect(target, Range("B:J")) Is Nothing Then target.Offset(0,
11).Select
If Not Intersect(target, Range("M:U")) Is Nothing Then target.Offset(0,
-11).Select
End Sub
Now I would like to build on that. My K Column is my delimiter with
the static text 'Totals'. I would like to be able to have the
functionality of the above without have the number of columns static,
so that if someone added a column prior to 'Totals', the range (in the
case above) B:J would grow to B:K (since totals is now column L) and
M:U would move and grow to N:W.
Does this make since? How can I do that?
The 'Totals' text is in cell K1. Knowing the start is column B and
ending is column with text 'totals', I think I can figure this out.
What I need is to know how to find the column of 'totals'.
I have a different macro which watches for data in the range M:U and
autofits the columns if new data arrives there. Do I need to and how
can I store the above calculated new range so that I can continue to
monitor the range?
Thanks again.
and m:u
Private Sub Workbook_SheetBeforeDoubleClick( _
ByVal Sh As Object, ByVal target As Range, Cancel As Boolean)
If Not Intersect(target, Range("B:J")) Is Nothing Then target.Offset(0,
11).Select
If Not Intersect(target, Range("M:U")) Is Nothing Then target.Offset(0,
-11).Select
End Sub
Now I would like to build on that. My K Column is my delimiter with
the static text 'Totals'. I would like to be able to have the
functionality of the above without have the number of columns static,
so that if someone added a column prior to 'Totals', the range (in the
case above) B:J would grow to B:K (since totals is now column L) and
M:U would move and grow to N:W.
Does this make since? How can I do that?
The 'Totals' text is in cell K1. Knowing the start is column B and
ending is column with text 'totals', I think I can figure this out.
What I need is to know how to find the column of 'totals'.
I have a different macro which watches for data in the range M:U and
autofits the columns if new data arrives there. Do I need to and how
can I store the above calculated new range so that I can continue to
monitor the range?
Thanks again.