Advertisement
Guest User

SplitDates

a guest
Dec 2nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub SplitDateUp()
  2. Dim lstRw As Long
  3. Dim i As Long
  4.  
  5. lstRw = Range("A" & Rows.Count).End(xlUp).Row
  6.  
  7. For i = lstRw To 2 Step -1
  8.     Cells(i, 2) = Year(Cells(i, 1))
  9.     Cells(i, 3) = "'" & Format(Cells(i, 1), "mm-mmm")
  10.     Cells(i, 4) = Year(Cells(i, 1)) & "-" & Evaluate("=WEEKNUM(A" & i & ")")
  11.     Cells(i, 5) = Format(Cells(i, 1) - DateSerial(2018, 1, 1), "0")
  12.    
  13. Next i
  14.  
  15. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement