Solved

How to add a Saturday date with VBA?

Posted on 2013-11-21
3
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

636 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