Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default While/Do Loop problem

Hi all,

I need help on VBA in XL2003 / XP Home.

I want to add a additional function to a while/do loop. I want to check by
vba the saturdays AND sundays in my calendar and mark it.

################################################## ##############
Private Sub TageFärben(DestTable As Worksheet, ByVal Kalenderjahr As
Integer)
Dim dat As Date
Dim AInterior As Interior

Set AInterior = TabPublics.Range(CFormatCellRange).Interior

dat = DateSerial(Kalenderjahr, 1, 1)
While Weekday(dat) < vbSunday here I want to check also
the saturdays !!!!!!!!
dat = dat + 1
Wend
Do
SetzeTagesfarbeVonDatum dat, DestTable, AInterior
dat = dat + 7
Loop While Year(dat) = Kalenderjahr
End Sub
################################################## ##############

Who can help ???

Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default While/Do Loop problem

Maybe...
While Weekday(dat) < vbSunday And _
Weekday(dat) < vbSaturday
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"MicrosoftNews"

wrote in message
Hi all,
I need help on VBA in XL2003 / XP Home.
I want to add a additional function to a while/do loop. I want to check by
vba the saturdays AND sundays in my calendar and mark it.

Private Sub TageFärben(DestTable As Worksheet, ByVal Kalenderjahr As
Integer)
Dim dat As Date
Dim AInterior As Interior
Set AInterior = TabPublics.Range(CFormatCellRange).Interior
dat = DateSerial(Kalenderjahr, 1, 1)
While Weekday(dat) < vbSunday 'here I want to check also the saturdays !
dat = dat + 1
Wend
Do
SetzeTagesfarbeVonDatum dat, DestTable, AInterior
dat = dat + 7
Loop While Year(dat) = Kalenderjahr
End Sub

Who can help ???
Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default While/Do Loop problem

http://www.cpearson.com/excel/newposte.htm
Reply
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
do loop problem [email protected] Excel Programming 3 June 20th 06 09:15 PM
Loop Problem smandula Excel Programming 2 April 6th 06 02:45 PM
Loop problem JohnUK Excel Programming 7 October 18th 05 04:03 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
Problem with Loop Mike Excel Programming 7 February 26th 04 09:12 PM


All times are GMT +1. The time now is 02:35 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"