I'm not sure what you are trying to do. I think the following does what you want: Function car(dnm As String) As Date Dim table(10) As Date
table(1) = #12/19/2008# For i = 2 To 9 table(i) = table(1) + i - 1 Next i table(10) = table(1) + 11 If dnm = "K1" Then car = table(2) ElseIf dnm = "K2" Then car = table(1) End If End Function If you still have problems please provide a more detailed explanation of your requirements Tom On Thu, Dec 11, 2008 at 11:12 AM, 2008ra...@gmail.com <2008ra...@gmail.com>wrote: > > hi, > > i writing below code for a function but it don't runing..where is the > problem..can you help me? > > function car(dnm) > tablo1 = 19 / 12 / 2008 > For i = 2 To 9 > tablo& i = tablo1 + i - 1 > Next i > tablo10 = tablo1 + 11 > if dnm = "K1" Then > car = tablo2 > elseif dnm = "K2" then > car = tablo1 > end if > end function > > ' i make new value for tablo2,3,4...... by for ..next but it don't > runing ( "tablo& i " eror area ) > how can i do it? > > > > --~--~---------~--~----~------------~-------~--~----~ Visit the blog to download Excel tutorials at http://www.excel-macros.blogspot.com To post to this group, send email to excel-macros@googlegroups.com For more options, visit this group at http://groups.google.com/group/excel-macros?hl=en Visit & Join Our Orkut Community at http://www.orkut.com/Community.aspx?cmm=22913620 Visit the blog to download Excel tutorials at http://www.excel-macros.blogspot.com To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com To see the Daily Excel Tips, Go to: http://exceldailytip.blogspot.com -~----------~----~----~----~------~----~------~--~---