Gaisen: The Vellichor

The strange wistfulness of used bookstores

I'm Gaisen Ko from Hong Kong

I am a clerk who is curious about the world and interested in writing small programs to improve my life.

我是一個對世界充滿好奇,又喜歡編寫一些小程式改善生活的小文員。

Here is a platform to share my feeling about a book, record my kayak adventure journey, concept of a program and problems when taking photo.

我希望在此記錄一些閱後感、Kayak的冒險之旅、編程概念和與攝影相關的問題。

Tools and programs I regular use:
  • Adobe Photoshop
  • Adobe Premiere
  • After Effects
  • Adobe PDF
  • MS Word
  • MS Excel
  • HTML
  • CSS
  • PHP
  • mySQL
  • VBA

This is what I want to share



List Group Level (MS Excel)

(30 Aug 2018)
Aims to get the Group level within a worksheet in different MS Excel files under a same foler

Sub listGroup()
    Dim mRef As Worksheet, wbMaster As Workbook
    Set wbMaster = ThisWorkbook
    Set mRef = wbMaster.Worksheets("Ref")
    
    'A worksheet that contain a number of data address
    Dim fPath As String, fFile As String
    Dim nAna As Integer, anaRow As Integer, anaCol As Integer
    fPath = mRef.Cells(4, 2)
    anaCol = mRef.Cells(6, 2)
    anaRow = mRef.Cells(7, 2)
    nAna = mRef.Cells(5, 2) + anaRow - 1

    For f = anaRow To nAna
        fFile = fPath & "\" & mRef.Cells(f, anaCol)
        Workbooks.Open (fFile)
        For i = 6 To 50
            Cells(i, 1).Value = ActiveSheet.Rows(i).OutlineLevel
        Next i
        'Save the File without asking
        ActiveWorkbook.Close Savechanges:=True
        'Clear the Variable
        fFile = ""
    Next f

End Sub





Some recent artworks



Write to ME


If you have any suggestion and recommendation of this web site, don't hesitate to contact me.

如果你對本站有任何意見,歡迎給我發來電郵。

Subject 標題:

Name 名字:

Email 電郵:

Yours Message 留言: