LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using DATE in VBA, gives error

Range("L" & c).Select
With Selection
.FormulaR1C1 = "DATE(YEAR(""" & t & """);" & "MONTH(""" & t & """)+" & b & " ;" & "DAY(""" & t & """))"
End With


What I try to do is this

.FormulaR1C1 = "=DATE(YEAR(""" & t & """);" & "MONTH(""" & t & """)+" & b & " ;" & "DAY(""" & t & """))"


However as soon as I put "=" in the code I get an error. Without the "=" the cells get filled with this:


DATE(YEAR("01.01.2005");MONTH("01.01.2005")+2 ;DAY("01.01.2005"))

if in the cell I put the "=" in front of this text I get exactly what I want = 01.03.2005


So why do I get an error in the code, if when I change the code later manually the formula is correct.


best regards
andreas

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Value Error Paula Excel Discussion (Misc queries) 6 February 9th 10 05:45 PM
date error hitesh via OfficeKB.com Excel Discussion (Misc queries) 1 October 20th 06 02:34 PM
Date error GregR[_2_] Excel Programming 8 March 3rd 05 08:28 PM
Date Error - HELP! Mikey Moe Excel Discussion (Misc queries) 1 February 6th 05 02:43 AM
Date Error Murray N Taylor Excel Programming 4 January 16th 04 09:51 AM


All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"