View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
tony tony is offline
external usenet poster
 
Posts: 313
Default Change day of week to day of month

Dave, I am tryign to use the following code to enter my formula in a cell but
keep receiving a Error 1004. IIs there anywahere I cna look up how to code
these formula statements?


Application.Goto Reference:="r5C6"
wsPh.Range("f5").Formula = "=IF(F" & 3 &
"<""DATE(YEAR($AE$1),MONTH($AE$1)"",F" & 3 & "),"""")"
Application.Goto Reference:="r5C7"
wsPh.Range("g5").Formula = "=IF(G" & 3 &
"<""DATE(YEAR($AE$1),MONTH($AE$1)"",G" & 3 & "),"""")"
etc....

"Dave Peterson" wrote:

=date(year(ae1),month(ae1),i3)

or just incorporate that into your =vlookup():

=vlookup(date(year(ae1),month(ae1),i3), sheet2!a:e,3,false)



Tony wrote:

I have a row that contains days of the month - cell I3(DD). I want to read
the cell and change to to the day of the month - cell AE1(MM/DD/YYYY) using
another cell that has the first day of the month entered - cell
I5(MM/DD/YYYY). The reason I have to do this is because I will have to use
the I5 cell data to do a vlookup afterwards.

cell I3 = 2
cell AE1 = 04/01/2009
cell I5 = 04/02/2009


--

Dave Peterson