Solved

Basic question about Excel Visual Basic

Posted on 2011-03-07
2
240 Views
Last Modified: 2012-05-11
I am in Excel and need a macro to evaluate a date that a user input into a cell that I've named "CarOne". If the date is not at least 910 days old, then I need a message box to appear which says "You have to wait until <X>" where <X> is a date 910 days after the date in CarOne.

Thanks!
0
Comment
Question by:carlosab
[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 10

Accepted Solution

by:
Makrini earned 500 total points
ID: 35065922
If Range("Carone") + 910 > Now() Then
        MsgBox ("You have to wait until ") & Format(Range("Carone") + 910, "dd/mm/yyyy")
    End If

Open in new window

0
 
LVL 6

Expert Comment

by:Eric Zwiekhorst
ID: 35066796
dear carlosab,

If the macro should be executed automaticaly when entering the date in carone you can do two things,

A) put on your sheet a combo box where the carone date has to be put. Use the Private Sub ComboBox1_Change() to look for changes in the combo box.
B) use the Private Sub Worksheet_Change(ByVal Target As Range) to look for changes in your cell and then execute the macro.


If you need an example of both possibilitys just ask and I will send you a excel...

Kind regards

Eric
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

726 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