Solved

Subtract Day in VBA Code

Posted on 2014-03-23
2
400 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

856 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