L
Ludo
Hi,
I would like to select 2 colomns using named ranges.
I use following code but i can't understand why columns B,C,D,E & F
are selected, while i only need column A & G
Sub TestRangeSelect()
Dim LastRow As Integer
Dim MyWeek As Range
Dim MyFPY As Range
Dim rngCell As Range
LastRow = Weeknumber(Now) + 3
With ActiveSheet
.Range(.Range("A3"), .Range("A" & LastRow)).Name = "Week2"
.Range(.Range("G3"), .Range("G" & LastRow)).Name = "FPY"
End With
FirstWeekAddress = Range("A3").Address
Set MyWeek = Names("week2").RefersToRange
Set MyFPY = Names("fpy").RefersToRange
'
With ActiveSheet
.Range(MyWeek, MyFPY).Select
End With
End Sub
thanks for your time,
Ludo
I would like to select 2 colomns using named ranges.
I use following code but i can't understand why columns B,C,D,E & F
are selected, while i only need column A & G
Sub TestRangeSelect()
Dim LastRow As Integer
Dim MyWeek As Range
Dim MyFPY As Range
Dim rngCell As Range
LastRow = Weeknumber(Now) + 3
With ActiveSheet
.Range(.Range("A3"), .Range("A" & LastRow)).Name = "Week2"
.Range(.Range("G3"), .Range("G" & LastRow)).Name = "FPY"
End With
FirstWeekAddress = Range("A3").Address
Set MyWeek = Names("week2").RefersToRange
Set MyFPY = Names("fpy").RefersToRange
'
With ActiveSheet
.Range(MyWeek, MyFPY).Select
End With
End Sub
thanks for your time,
Ludo