Results 1 to 2 of 2

Thread: link b/w workbooks "format(now-1)"

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Location
    boston
    Posts
    22
    Hello,

    Can anyone fix this 1 line of code?
    ActiveCell.FormulaR1C1 = "=Sum('C:\Temp\\[" & Format(Now - 1, "mm-dd-yy") & "]\Report" & Format(Now - 1, "mm-dd-yy")Shadow'!R11C6"
    Thank you for any feedback!

  2. #2
    Addicted Member Michael Woolsey's Avatar
    Join Date
    Nov 2000
    Location
    Calgary, Alberta, Canada.
    Posts
    243
    Try this:

    Code:
    ActiveCell.FormulaR1C1 = "=Sum('C:\Temp\\[" & Format(DateAdd("d", -1, Now), "mm-dd-yy") & "]\Report" & Format(DateAdd("d", -1, Now), "mm-dd-yy") & "Shadow'!R11C6"
    Basically I'm replacing the Now - 1 with a DateAdd("d", -1, Now), and adding a '& "' that was missing...

    I haven't tested this, though it should work fine...

    Hope this helps.
    Michael
    Application/Web Developer

    Visual Basic 6.0 SP5
    Active Server Pages
    Oracle 9i
    - I'm going to live forever, or die trying!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width