Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2004, 01:53 PM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Trancefuzion Send a message via Yahoo to Trancefuzion
Default A simple question about date in VBA for Excel 2002

Hi,

I have some difficulties with this code:



code:
--------------------------------------------------------------------------------

Columns("L:L").Select
Selection.NumberFormat = "m/d/yyyy;@"

//Compte is the number of cells i have in a column
colonneA = "A2:A" & (Compte + 1)
indice = 2
Sheets("SOURCE").Select
Range(colonneA).Select
For Each cell In Application.Selection
            adrL = "L" & indice
            ladate = Range("adrL").Value //here is my problem, Range("adrL").Value is not a date...
            Mois = Month(ladate)
            ...
Next

--------------------------------------------------------------------------------




Range("adrL").Value is not a date. I don't understand because I set it before...

Does somebody can help me?


TranceFuZion
Booking: [email protected]
www.trancefuzion.com

Inline DJ
www.inlinedj.com
 
Old July 20th, 2004, 02:18 PM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Trancefuzion Send a message via Yahoo to Trancefuzion
Default

Ok i found my error...

Thanks!

TranceFuZion
Booking: [email protected]
www.trancefuzion.com

Inline DJ
www.inlinedj.com
 
Old July 29th, 2004, 04:37 AM
Authorized User
 
Join Date: Jul 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello,

Delete the quotes in ladate = Range("adrL").Value
change is now ladate = Range(adrL).Value

Bey








Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002 VBA Programmer's Reference hawlk VB How-To 0 February 4th, 2007 04:35 PM
New VBA user has simple question Michele_Haywood Access 2 September 26th, 2006 03:52 PM
Suspected Error in "Excel 2002 VBA" book rstober Excel VBA 7 September 2nd, 2004 05:48 PM
Simple Date question risu VB.NET 2002/2003 Basics 7 November 12th, 2003 12:43 PM
Excel 2002 VBA Programmers Guide quinoman Wrox Book Feedback 1 June 9th, 2003 09:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.