Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default evaluate a year expression

What is the proper expression to eval the following formula?? I keep getting
#name? in my spreadsheet.

Thanks

For i = 2007 To 2009


Selection.AutoFilter
Range("F3").Select
ActiveCell.FormulaR1C1 = "=YEAR(RC[-5])=i"

..
..
..
..
next i
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default evaluate a year expression

You are probably looking for the formula to be
ActiveCell.FormulaR1C1 = "=YEAR(RC[-5])=" & i

but it really depends on what you are trying to do, your variable i was just
plugged in as a letter since it was in "".
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Clint Eastwood" wrote:

What is the proper expression to eval the following formula?? I keep getting
#name? in my spreadsheet.

Thanks

For i = 2007 To 2009


Selection.AutoFilter
Range("F3").Select
ActiveCell.FormulaR1C1 = "=YEAR(RC[-5])=i"

.
.
.
.
next i

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default evaluate a year expression

John,
That solved the problem. Thanks. If you need more info to give to someone
else ( the rest of the code?0 let me know. Again, thanks !!
Clint E.
"John Bundy" wrote:

You are probably looking for the formula to be
ActiveCell.FormulaR1C1 = "=YEAR(RC[-5])=" & i

but it really depends on what you are trying to do, your variable i was just
plugged in as a letter since it was in "".
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Clint Eastwood" wrote:

What is the proper expression to eval the following formula?? I keep getting
#name? in my spreadsheet.

Thanks

For i = 2007 To 2009


Selection.AutoFilter
Range("F3").Select
ActiveCell.FormulaR1C1 = "=YEAR(RC[-5])=i"

.
.
.
.
next i

Reply
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
evaluate a concatenate expression Russell.Ivory[_2_] Excel Worksheet Functions 3 November 4th 09 05:52 PM
Combination Graph with current year and prior year sales JanW Charts and Charting in Excel 2 April 5th 07 09:20 PM
trying to get day/month/year froamt while user enters year only RADIOOZ New Users to Excel 3 June 7th 06 05:30 AM
Evaluate Custom Expression Peter Excel Programming 7 April 3rd 06 01:18 PM
How to evaluate a text expression as formula ? Krzysztof Klimczak Excel Programming 0 August 29th 03 04:31 PM


All times are GMT +1. The time now is 10:10 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"