Solved

Subtract Day in VBA Code

Posted on 2014-03-23
2
389 Views
Last Modified: 2014-03-23
I need to subtract 1 day from Date Input or where Trade is entered it is date minus 1 day from Date Input.  Thanks in advance.



Trade = Sheets("Date Input").Range("B3")
For row = 1 To ColumnCount
           
       

         Sheet1.Cells(List, 2).Value = Trade
0
Comment
Question by:leezac
2 Comments
 
LVL 19

Accepted Solution

by:
regmigrant earned 270 total points
ID: 39949186
If you subtract '1' from a date field Excel will return a date one day earlier than input date - this is default behaviour, what else do you need?

Trade = Sheets("Date Input").Range("B3") - 1
0
 

Author Closing Comment

by:leezac
ID: 39949196
I think that I will just subtract a day from the input date.  Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

705 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

19 Experts available now in Live!

Get 1:1 Help Now