Solved

How to add a Saturday date with VBA?

Posted on 2013-11-21
3
227 Views
Last Modified: 2013-11-21
I need a code to place this week's Saturday's date in cell T2.
No matter what day I run the code I need to place this week's Saturday's date.
Thanks,
Jimi
0
Comment
Question by:Jimi Sherman
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
Flyster earned 500 total points
ID: 39667980
This code should give you what you're looking for:
Sub InsertSaturday()
  ActiveSheet.Range("T2") = Date + (7 - Weekday(Date))
End Sub

Open in new window

Flyster
0
 

Author Closing Comment

by:Jimi Sherman
ID: 39668041
Thanks
0
 
LVL 22

Expert Comment

by:Flyster
ID: 39668050
You're Welcome!
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question