R
R Tanner
Hi----this is part of a much larger program, that I am testing
separately, if you are wondering what the heck I would use it
for.
I am trying to use the worksheet function vlookup in my code but it
keeps telling me
'unable to use the worksheet function vlookup class' when it gets to
that point in the code...
any idea how I should code this differently to make it work??
Thanks...
Sub makedayofweek()
Dim RANGEENTRIES As Range, NUMENTRIES As Integer, Mydate As Range,
Test As Range
Range("B22").Select
Set RANGEENTRIES = Range("B22", ActiveCell.End(xlToRight))
RANGEENTRIES.Select
NUMENTRIES = RANGEENTRIES.Columns.Count
Range("B12").Select
For i = 1 To NUMENTRIES
Set WDAY = ActiveCell
WDAY.Select
ActiveCell =
Application.WorksheetFunction.Weekday(ActiveCell.Offset(10, 0), 2)
ActiveCell.Offset(0, 1).Select
Next i
Set Test = ActiveCell.Offset(1, 0)
Range("B11").Select
For i = 1 To NUMENTRIES
Set Mydate = ActiveCell
Mydate.Value = Application.WorksheetFunction.VLookup(Test,
Range("E53:E59"), 2)
Mydate.Offset(0, 1).Select
Next i
End Sub
separately, if you are wondering what the heck I would use it
for.
I am trying to use the worksheet function vlookup in my code but it
keeps telling me
'unable to use the worksheet function vlookup class' when it gets to
that point in the code...
any idea how I should code this differently to make it work??
Thanks...
Sub makedayofweek()
Dim RANGEENTRIES As Range, NUMENTRIES As Integer, Mydate As Range,
Test As Range
Range("B22").Select
Set RANGEENTRIES = Range("B22", ActiveCell.End(xlToRight))
RANGEENTRIES.Select
NUMENTRIES = RANGEENTRIES.Columns.Count
Range("B12").Select
For i = 1 To NUMENTRIES
Set WDAY = ActiveCell
WDAY.Select
ActiveCell =
Application.WorksheetFunction.Weekday(ActiveCell.Offset(10, 0), 2)
ActiveCell.Offset(0, 1).Select
Next i
Set Test = ActiveCell.Offset(1, 0)
Range("B11").Select
For i = 1 To NUMENTRIES
Set Mydate = ActiveCell
Mydate.Value = Application.WorksheetFunction.VLookup(Test,
Range("E53:E59"), 2)
Mydate.Offset(0, 1).Select
Next i
End Sub