LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default I have no clue about how to use vba

Here is what I have to accomplish and I do not know how to do it. It is
based on a worksheet. Can someone help me?

Public Sub FlagQuotas()
Dim rngActiveCell As Range
Dim blnExhibition As Boolean
Dim blnRegSeason As Boolean
Dim blnPlayoffs As Boolean
' FOR SECTION 4...
' DECLARE YOUR 4 TICKET HOLDER NAME VARIABLES HERE.
' USE "DIM" STATEMENTS FOR THIS PROCESS.


' Clear the range of tickets sold of any formats.
Range("TicketsSold").ClearFormats

' FOR SECTION 4...
' INITIALIZE YOUR 4 TICKET HOLDER NAME VARIABLES HERE. ASSIGN THEM A
VALUE
' OF 0.
' USE 4 ASSIGNMENT STATEMENTS FOR THIS PROCESS.


' Loop through the tickets sold range. Examine each cell, one
' at a time. Determine its ticket type using its row number.
For Each rngActiveCell In Range("TicketsSold")
Select Case rngActiveCell.Row
Case 4, 7, 10, 13
blnExhibition = True
blnRegSeason = False
blnPlayoffs = False
Case 5, 8, 11, 14
blnExhibition = False
blnRegSeason = True
blnPlayoffs = False
Case 6, 9, 12, 15
blnExhibition = False
blnRegSeason = False
blnPlayoffs = True
Case Else
MsgBox "Error in rngActiveCell.Row." & _
"Value of rngActiveCell.Row: " & _
rngActiveCell.Row
Exit Sub
End Select

' Now that we know the active cell's ticket type, check to see if it's
' equal or greater than its designated quota.
' Exhibition...
If blnExhibition = True Then
If rngActiveCell.Value = Range("ExhibQuota") Then
rngActiveCell.Interior.Color = vbYellow
' FOR SECTION 4...
' DETERMINE THE CURRENT TICKET HOLDER USING THE
' rngActiveCell.Column PROPERTY IN A SELECT CASE STATEMENT.
' KNOWING THE COLUMN TELLS YOU WHICH TICKET HOLDER'S VARIABLE
' YOU NEED TO ADD 1 TO.
' USE A SELECT CASE STATEMENT HERE THAT REFERS TO THE
' rngActiveCell.Column PROPERTY. NOTE THAT THIS VALUE WILL
' BE A NUMBER, NOT A LETTER (i.e. - "Jack M." uses column D,
but
' the Column property returns 4).

GoTo LoopingMarker
End If
End If
' Regular season...
If blnRegSeason = True Then
If rngActiveCell.Value = Range("RegQuota") Then
rngActiveCell.Interior.Color = vbYellow
' FOR SECTION 4...
' DETERMINE THE CURRENT TICKET HOLDER USING THE
' rngActiveCell.Column PROPERTY IN A SELECT CASE STATEMENT.
' KNOWING THE COLUMN TELLS YOU WHICH TICKET HOLDER'S VARIABLE
' YOU NEED TO ADD 1 TO.
' USE A SELECT CASE STATEMENT HERE THAT REFERS TO THE
' rngActiveCell.Column PROPERTY. NOTE THAT THIS VALUE WILL
' BE A NUMBER, NOT A LETTER (i.e. - "Jack M." uses column D,
but
' the Column property returns 4).

GoTo LoopingMarker
End If
End If
' Playoffs...
If blnPlayoffs = True Then
If rngActiveCell.Value = Range("PlayQuota") Then
rngActiveCell.Interior.Color = vbYellow
' FOR SECTION 4...
' DETERMINE THE CURRENT TICKET HOLDER USING THE
' rngActiveCell.Column PROPERTY IN A SELECT CASE STATEMENT.
' KNOWING THE COLUMN TELLS YOU WHICH TICKET HOLDER'S VARIABLE
' YOU NEED TO ADD 1 TO.
' USE A SELECT CASE STATEMENT HERE THAT REFERS TO THE
' rngActiveCell.Column PROPERTY. NOTE THAT THIS VALUE WILL
' BE A NUMBER, NOT A LETTER (i.e. - "Jack M." uses column D,
but
' the Column property returns 4).

GoTo LoopingMarker
End If
End If
LoopingMarker:
' Return to the beginning of the loop to get the next active cell in
' the range of tickets sold.
Next

' FOR SECTION 4...
' INDIVIDUALLY ASSIGN EACH OF THE TICKET HOLDER NAME VARIABLES TO ITS
' CORRESPONDING ROW 16 CELL (i.e. - Assign the variable for "Jack M."
' to D16).
' USE 4 ASSIGNMENT STATEMENTS FOR THIS PROCESS.


' FOR SECTION 4...
' ADD UP ALL 4 OF THE TICKET HOLDER NAME VARIABLES AND CONCATENATE THE
' TOTAL TO THE BELOW MsgBox STATEMENT. RECALL THAT CONCATENATING STRINGS
' IS PEFORMED USING "&". SEE THE ABOVE MsgBox STATEMENT AS AN EXAMPLE.
MsgBox "Processing completed! The total count of MBE cells was: "
End Sub





--
Amy Howell
 
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
Solving the 'CLUE' Murder DaleFlyFisher Excel Worksheet Functions 2 April 10th 08 07:13 PM
error message - no clue what it is about smritisuman Excel Discussion (Misc queries) 1 December 7th 06 08:04 AM
SUMPRODUCT clue needed Dallman Ross Excel Discussion (Misc queries) 5 September 25th 06 12:29 PM
Not a clue of which function to use! y_not Excel Discussion (Misc queries) 1 April 11th 06 07:23 PM
I have not got a clue emailreynolds Excel Discussion (Misc queries) 1 August 25th 05 06:12 PM


All times are GMT +1. The time now is 12:07 AM.

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

About Us

"It's about Microsoft Excel"