LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
KC KC is offline
external usenet poster
 
Posts: 107
Default Enum type variables

Good morning

For exercise,
I have weekdays in row 1, Sun, Mon, Tue...Sat and repeat
To highlight every Sunday, I use this code below.

I would like to seek advice if I can read contents in cells as value in the
enum variable, ie can I get rid of the first set of select case please?

Enum wkdays
sun = 6
End Enum

Sub test()
Dim eidx As wkdays

For k = 1 To Cells(1, 1).End(xlToRight).Column

Select Case Cells(1, k)
Case "Sun"
eidx = sun
Case Else
eidx = 0
End Select

Select Case eidx
Case sun
Columns(k).Interior.ColorIndex = sun
End Select

Next k

End Sub

 
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
Excel 97 Enum Larry Dodd[_2_] Excel Programming 5 April 11th 05 11:15 AM
Enum Daniel[_4_] Excel Programming 3 December 22nd 03 12:30 AM
Enum in Excel 97 Rob Bovey Excel Programming 0 September 26th 03 11:02 PM
Enum in Excel 97 Chip Pearson Excel Programming 0 September 26th 03 10:03 PM


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