Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to write a macro in Excel 2003. In this macro, I want to
use the date values of three different dates, but I'm not able to make it work. The code below shows three different methods I've tried, but they all just return 0. I have also tried using Double or Date instead of Integer, but it turns out the same. When debugging this code, it looks like the second range selection doesn't work. Any suggestions? With ActiveSheet .Range(.Cells(5, 9), Cells(7, 9)).Select '... Dim dateBefore As Integer Dim dateSepTest As Integer Dim dateAfter As Integer dateBefore = .Range(.Cells(5, 1)).Value dateSepTest = .Range(.Cells(6, 1)).Formula .Range(.Cells(7, 1)).Select dateAfter = Selection.Formula MsgBox("dateBefore = " & dateBefore) MsgBox("dateSepTest = " & dateSepTest) MsgBox("dateAfter = " & dateAfter) End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating Intermediate Date Values - New Problem | Excel Programming | |||
Date Formula Problem - Leave date blank if Null | Excel Worksheet Functions | |||
How do I convert date values to non-date format e.g. 01-06-78? | Excel Discussion (Misc queries) | |||
Date values Problem | Excel Programming | |||
autofilter problem with date values | Excel Programming |