×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    some xecel vba script to make wikiTables from excel ones.

    
    
    Sub do_conversion()
    ' sub to convert excel tables in to wikiTables
    '---------
    'version 0.1  DrOwl 2006.06.19
    '0.1.1 DrOwl 2006.06.20
    ' some minor tweek to the output order
    '---------
    ' ToDo:
    ' work with colors and colom sizes
    ' Emphised Title
    ' imput dialog for range selection
    ' range selection from "slected"
    ' imput dialog options for alignment, color, sizes
    
    
    Dim imputSheet As String
    Dim outputSheet As String
    
    Dim startCol As Single
    Dim startRow As Single
    Dim endCol As Single
    Dim endRow As Single
    
    Dim X As Single
    Dim Y As Single
    Dim Z As Single
    
    
    Dim txtAlign As String
    Dim headAlign As String
    Dim border As Boolean
    
    
    Let imputSheet = "sheet3"
    Let outputSheet = "sheet4"
    Let Z = 1
    
    Let startRow = 2
    Let endRow = 12
    Let startCol = 1
    Let endCol = 5
    
    Let txtAlign = "Center"
    Let headAlign = "Left"
    
    
    Sheets(outputSheet).Select
    Range("A:A").Delete
    
    headerTxt = "{|"
    If border = True Then
        headerTxt = headerTxt & " border=1"
    End If
    
    If headAlign <> "" Then
    
        headerTxt = headerTxt & " align=" & headAlign
    
    End If
    
        Sheets(outputSheet).Cells(Z, 1).Value = headerTxt
        
        Let Z = Z + 1
        
    For Y = startRow To endRow
    
        
    
        
        For X = startCol To endCol
        
            CellText = Sheets(imputSheet).Cells(Y, X).Value
    '        Bold = Sheets("sheet3").Cells(y, x).Bold
            
            If align <> "" Then
            
                Sheets(outputSheet).Cells(Z, 1).Value = "|align=" & txtAlign & "|" & CellText
            
            Else
            
                Sheets(outputSheet).Cells(Z, 1).Value = "|" & CellText
            
            End If
            Let Z = Z + 1
            Sheets(outputSheet).Cells(Z, 1).Value = "|---"
            Let Z = Z + 1
        Next X
        
    
        
    Next Y
    
       Sheets(outputSheet).Cells(Z, 1).Value = "|}"
    
    End Sub
    
    

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.