Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Basic question about Excel Visual Basic

Posted on 2011-03-07
2
Medium Priority
?
245 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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…
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!
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
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…

598 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