Hello,
Few days ago, Marc L show me in topic
http://forum.chandoo.org/threads/copy-between-2-workbooks-in-dynamic-range.27098/
how to find a change position of screen to view taday's date on my table.
It's works fine but now I change a way to work on this ranges.
Now, I'd like to help for new issue.
1. When worksheet is activate I'd like to change position on date from Cell B8.
I have 2 scrollbars (2 ranges)
I'd like to move to date automatically when worksheeet is activate.
2 ranges at the same time.
2. It's possible to aggregate my 2 ranges on 1 scroll bar. (2nd unvisible).
Thanks, in advance.
Few days ago, Marc L show me in topic
http://forum.chandoo.org/threads/copy-between-2-workbooks-in-dynamic-range.27098/
how to find a change position of screen to view taday's date on my table.
It's works fine but now I change a way to work on this ranges.
Now, I'd like to help for new issue.
1. When worksheet is activate I'd like to change position on date from Cell B8.
I have 2 scrollbars (2 ranges)
I'd like to move to date automatically when worksheeet is activate.
2 ranges at the same time.
2. It's possible to aggregate my 2 ranges on 1 scroll bar. (2nd unvisible).
Thanks, in advance.
Code:
Sub scrol_1()
Moveon ActiveSheet.Shapes(Application.Caller), "D", "CVA", 8
End Sub
Sub scrol_2()
Moveon ActiveSheet.Shapes(Application.Caller), "CVF", "EMA", 4
End Sub
Sub Moveon(Shp As Shape, columnn1 As String, columnn2 As String, howmanyVisible As Long)
Dim kol1 As Range
Dim kol2 As Range
Set kol1 = Columns(columnn1)
Set kol2 = Columns(columnn2)
Application.ScreenUpdating = False
'Range(kol1, kol2).EntireColumn.Hidden = False
Range(kol1, kol2).EntireColumn.Hidden = True
With Shp.OLEFormat.Object
.Min = kol1.Column
.Max = kol2.Column - howmanyVisible + 1
Columns(.Value).Resize(, howmanyVisible).Hidden = False
End With
Application.ScreenUpdating = True
End Sub
Attachments
Last edited: