Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Addie Jackson   on Aug 18 In MS Office Category.

  
Question Answered By: Keiko Mori   on Aug 18

The code I sent previously did not include the logic for yesterday's


Dim NewRow
Dim NewDate

NewRow = ActiveCell.Row
NewDate = Now()

Select Case Weekday(NewDate)
'Sunday = 1, Saturday = 7
'Monday looking for Friday
Case 2
NewDate = Now() - 3
'otherwise just yesterdays date
Case Else
NewDate = Now() - 1
End Select

NewDate = Format(NewDate, "MMdd")
Selection.Formula = "=VLOOKUP(D" & NewRow & ",RMRegArray" & NewDate
& ",8,FALSE)"

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on dynamic macros and named ranges questions Or get search suggestion and latest updates.


Tagged: