Forum Discussion

Kasey_Vincent's avatar
Kasey_Vincent
Copper Contributor
Jul 25, 2019
Solved

(Excel) Pulling date from another sheet, adding one week to it

I know I’m a little late to the party here, but Im trying to pull a date from a previous sheet and add it to the next sheet, while adding 7 days to the date. Is there a macro on how to do this? I’ve ...
  • Kasey_Vincent's avatar
    Jul 25, 2019

    Okay, Never mind. I figured it out. It turns out it was a really simple formula after adding that macro for the PrevSheet object. All I had to do was add +7 to the end of it. I was way overthinking it. Maybe by leaving this here it will help someone else. My formula in the K1 field looks like this now:

     

    =PrevSheet(K1)+7

     

    And the macro as I said earlier was:

    Function PrevSheet(RCell As Range)
    Dim xIndex As Long
    Application.Volatile
    xIndex = RCell.Worksheet.Index
    If xIndex > 1 Then _
    PrevSheet = Worksheets(xIndex – 1).Range(RCell.Address)
    End Function



Resources