home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "Module1"
- Option Explicit
- ' ╙╔╙┌╩²╛▌╬─╝■╬¬ Excel ╬─╝■ú¼╦∙╥╘╖╓▒≡╢¿╥σ╣ñ╫≈▓╛║═╣ñ╫≈▒φ
- Public wbWorld As Object
- Public shtWorld As Object
-
- Sub Setup()
- ChDir App.Path
- ChDrive App.Path
- ' ╗±╚í WORLD.XLS ╓╨╡─╡┌╥╗╕÷╣ñ╫≈▒φ
- Set shtWorld = GetObject("world.xls")
- ' ╗±╚í╣ñ╫≈▓╛
- Set wbWorld = shtWorld.Application.Workbooks("world.xls")
- End Sub
-
- ' ╜½╢╘╧≤╔Φ╓├╬¬ Nothingíú
- Sub CleanUp()
- ' ╥¬╩╟├╗╙╨╞Σ╦√╙ª╙├│╠╨≥╗≥╙├╗º╜½ Microsoft Excel ╝╙╘╪ú¼
- ' ╒Γ╜½╟┐╓╞╜½╞Σ╨╢╘╪íú
- Set shtWorld = Nothing
- Set wbWorld = Nothing
- End Sub
-
- ' ╙├╣ñ╫≈▓╛╓╨╡─╣ñ╫≈▒φ├√╠ε│Σ Continents ╫Θ║╧┐≥
- Sub FillContinentsList()
- Dim shtContinent As Excel.Worksheet
-
- ' ▒Θ└·╣ñ╫≈▒φ╝»║╧ú¼▓ó╜½├┐╒┼╣ñ╫≈▒φ╡─├√│╞╠φ╝╙╡╜╫Θ║╧┐≥╓╨
- For Each shtContinent In wbWorld.Sheets
- frmGeoFacts.cmbContinents.AddItem shtContinent.Name
- Next
- ' ╤í╢¿╡┌╥╗╧ε▓ó╧╘╩╛╘┌╫Θ║╧┐≥╓╨
- frmGeoFacts.cmbContinents.Text = frmGeoFacts.cmbContinents.List(0)
-
- Set shtContinent = Nothing
- End Sub
-
- ' ╙├╕°╢¿╡─╙δ┤≤┬╜╧α╣╪╡─╠╪╒≈╡─├√│╞╠ε│Σ╡╜ Continents ╫Θ║╧┐≥╓╨
- Sub FillFeaturesList()
- Dim shtContinent As Excel.Worksheet
- Dim rngFeatureList As Excel.Range
- Dim intFirstBlankCell As Integer
- Dim loop1 As Integer
-
- ' ╥■║¼╛╔╡─ lstTopRanking ┴╨▒φ┐≥.
- frmGeoFacts.lstTopRanking.Visible = False
-
- ' ╗±╚í╘┌ Continents ╫Θ║╧┐≥╓╨╤í╢¿╡─┤≤┬╜├√│╞╡─╣ñ╫≈▒φ
- Set shtContinent = wbWorld.Sheets(frmGeoFacts.cmbContinents.Text)
- ' ╜½╒Γ╕÷╣ñ╫≈▒φ╡─╡┌╥╗╨╨╕│╓╡╕°╥╗╕÷╢╘╧≤
- Set rngFeatureList = shtContinent.Rows(1)
-
- ' ┼╨╢╧╩╟╖±╬¬┐╒┴╨▒φ
- If (rngFeatureList.Cells(1, 1) = "") Then
- intFirstBlankCell = 0
- Else
- ' ▓Θ╒╥╡┌╥╗╕÷┐╒╡Ñ╘¬╡─╦∙╘┌╨╨
- intFirstBlankCell = rngFeatureList.Find("").Column
- End If
-
- ' ╟σ┐╒ features ╫Θ║╧┐≥╓╨╟░├µ╡──┌╚▌
- frmGeoFacts.cmbFeatures.Clear
-
- ' ╠φ╝╙╧ε╡╜ features ╫Θ║╧┐≥
- For loop1 = 1 To intFirstBlankCell
- frmGeoFacts.cmbFeatures.AddItem rngFeatureList.Cells(1, loop1)
- Next
-
- ' ╤í╢¿╡┌╥╗╧ε▓ó╧╘╩╛╘┌╫Θ║╧┐≥╓╨
- frmGeoFacts.cmbFeatures.Text = frmGeoFacts.cmbFeatures.List(0)
-
- ' ╟σ│²
- Set shtContinent = Nothing
- Set rngFeatureList = Nothing
- End Sub
-
- ' ╠ε│Σ lstTopRanking ┴╨▒φ┐≥
- Sub FillTopRankingList()
- Dim shtContinent As Excel.Worksheet
- Dim intColumOfFeature As Integer
- Dim rngRankedList As Excel.Range
- Dim intFirstBlankCell As Integer
- Dim loop1 As Integer
-
- ' ╗±╚í╘┌ Continents ╫Θ║╧┐≥╓╨╤í╢¿╡─┤≤┬╜├√│╞╡─╣ñ╫≈▒φ
- Set shtContinent = wbWorld.Sheets(frmGeoFacts.cmbContinents.Text)
-
- ' ╟σ┐╒ ranking ┴╨▒φ┐≥╓╨╟░├µ╡──┌╚▌
- frmGeoFacts.lstTopRanking.Clear
-
- ' ╚τ╣√ feature ╫Θ║╧┐≥╓╨╤í╢¿╬¬┐╒ú¼▓╗╫÷╚╬║╬▓┘╫≈
- If (frmGeoFacts.cmbFeatures <> "") Then
-
- ' ▓Θ┐┤╘┌╡τ╫╙╩²╛▌▒φ╓╨╡┌╥╗╨╨╓╨╙╔ feature ╤í╢¿╡─┴╨
- intColumOfFeature = shtContinent.Rows(1).Find(frmGeoFacts.cmbFeatures.Text).Column
-
- ' ╜½╕├┴╨╕│╓╡╕°╥╗╕÷╢╘╧≤
- Set rngRankedList = shtContinent.Columns(intColumOfFeature)
-
- ' ┼╨╢╧╩╟╖±╬¬┐╒┴╨▒φ
- If (rngRankedList.Cells(1, 1) = "") Then
- intFirstBlankCell = 0
- Else
- ' ▓Θ╒╥╡┌╥╗╕÷┐╒╡Ñ╘¬╡─╦∙╘┌╨╨
- intFirstBlankCell = rngRankedList.Find("").Row
- End If
-
- ' ╠φ╝╙╧ε╡╜ TopRanking ┴╨▒φ┐≥
- For loop1 = 2 To intFirstBlankCell
- frmGeoFacts.lstTopRanking.AddItem rngRankedList.Cells(loop1, 1)
- Next
-
- ' ╧╘╩╛╨┬╡─ ranking ┴╨▒φ
- frmGeoFacts.lstTopRanking.Visible = True
-
- End If
-
- ' ╟σ│²
- Set shtContinent = Nothing
- Set rngRankedList = Nothing
- End Sub
-