LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default sometimes it takes one variable, sometimes another ...

Given the following:

sub start()
Dim this_day, MyMonth, MyDay, MyYear, MyWeekDay, This_Month
this_day = Date
MyWeekDay = Weekday(this_day)
Select Case MyWeekDay
Case 1
this_day = this_day - 2
Case 2
this_day = this_day - 3
Case 3
this_day = this_day - 1
Case 4
this_day = this_day - 1
Case 5
this_day = this_day - 1
Case 6
this_day = this_day - 1
Case 7
this_day = this_day - 1
End Select

MyMonth = Month(this_day)
MyDay = Day(this_day)
MyYear = Year(this_day)

Select Case MyMonth
Case 1
This_Month = "Jan."
Case 2
This_Month = "Feb."
Case 3
This_Month = "March"
Case 4
This_Month = "April"
Case 5
This_Month = "May"
Case 6
This_Month = "June"
Case 7
This_Month = "July"
Case 8
This_Month = "Aug."
Case 9
This_Month = "Sept."
Case 10
This_Month = "Oct."
Case 11
This_Month = "Nov."
Case 12
This_Month = "Dec."
End Select


Load dayprompt
dayprompt.the_Month.Text = This_Month
dayprompt.the_day.Value = MyDay
dayprompt.the_Year.Text = MyYear
dayprompt.Show
end sub

dayprompt the form has three list boxes, the_Month, the_Day, the_year
....

It initalizes the value for either the_Month or the_Year, but never
both at the same time -- unless you click on the list box -- and it
always does the the_Day.

suggestions please ...
thanks in advance.


Larry Levinson
Talking up to the vocal ...
LLevinson*Bloomberg.net
(remove the star etc ....)
 
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
How many iterations it takes to get to 0? Rick Excel Worksheet Functions 12 May 10th 07 10:46 PM
What it takes for Excel to run faster ? Steven Vegeta Excel Discussion (Misc queries) 2 August 6th 06 08:47 PM
TAB key takes cursor to other end of sheet... Nat Excel Discussion (Misc queries) 2 April 10th 06 08:05 PM
Save takes seconds vs. SaveAs/Save As takes minutes Andrew H[_3_] Excel Programming 0 August 17th 04 07:17 PM
VBE takes two tries to hear me clearly... Mark Tangard Excel Programming 3 September 8th 03 08:23 AM


All times are GMT +1. The time now is 04:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"