?
Solved

Subtract Day in VBA Code

Posted on 2014-03-23
2
Medium Priority
?
413 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

649 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