View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
leonidas[_54_] leonidas[_54_] is offline
external usenet poster
 
Posts: 1
Default Insert dates from a userform


Hi,

I have a userform with textbox3 and textbox4. The user can insert a
startdate in textbox3 and insert an enddate in textbox4. The code below
fills cells B10 and below with the dates between the startdate and
enddate and the weekends are excluded. The only problem is that by
excluding the weekends the enddate automatically changes to a later
date.
What should I change to get the enddate as last date in column B and
still exclude the weekends? Thanks in advance!


Code:
--------------------
Range("B10").Select
With Selection
.Value = CDate(TextBox3.Text)
.NumberFormat = "dd/mm/yyyy"
.AutoFill .Resize(CDate(TextBox4.Text) - CDate(TextBox3.Text) _
+ 1), Type:=xlFillWeekdays
End With
--------------------


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=566533