View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tjtjjtjt tjtjjtjt is offline
external usenet poster
 
Posts: 51
Default Find the Sunday with min value

I am looking in a range of dates to find the minimum date. Once it is found,
I will find what weekday it is. If it isn't a Sunday, I go to the smallest
Sunday larger than the Minimum date to set the starting point for my code.

I have everything working, except I can't seem to transfer the cell with the
minimum date to a range variable.

This was my latest attempt:
Set rng = Range(fst.Address & ":A" & Cells(Rows.Count, "A").End(xlUp).Row)
Set dmin = rng.Find(Application.WorksheetFunction.Min(rng))

dmin is always set to Nothing.

What do I need to do to set dmin as the cell containing the minimum date?

Also, since it is possible that "fst" may not be in column A, is there a
more flexible way to set my "rng" variable?

Thanks,
--
tj