SOLVED

[Solved] Macro Formula to set cell to Start of Current Week

Copper Contributor

Edit: Thank you, Quadruple_Pawn, for the help.

I am trying to make a macro button to set a cell to the Monday of the week I am on. Currently the output is getting the start of the week of Jan,1900 only instead of current date. Setting the value to = Weekday(date, 2) just makes it 4th of Jan,1900 instead.

 

Send help. T_T

 

Current Macro:
Sub StartWeek()
   Range("C4").Value = Weekday(2)
End Sub
Current Output:

2-Jan-1900
1 Reply
best response confirmed by Kevin2069 (Copper Contributor)
Solution

@Kevin2069 

Sub StartWeek()
Range("C4").Value = Date - Weekday(Date) + 2
End Sub

 

You can try this code.

1 best response

Accepted Solutions
best response confirmed by Kevin2069 (Copper Contributor)
Solution

@Kevin2069 

Sub StartWeek()
Range("C4").Value = Date - Weekday(Date) + 2
End Sub

 

You can try this code.

View solution in original post