?
Solved

Subtract Day in VBA Code

Posted on 2014-03-23
2
Medium Priority
?
411 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
[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 Comments
 
LVL 19

Accepted Solution

by:
regmigrant earned 1080 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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.

801 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