Solved

How to add a Saturday date with VBA?

Posted on 2013-11-21
3
225 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
Comment Utility
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
Comment Utility
Thanks
0
 
LVL 22

Expert Comment

by:Flyster
Comment Utility
You're Welcome!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now