Results 1 to 10 of 62

Thread: BBCode Table

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    @Admin
    How do you get your code to look “normal” in a php Window .. when I try my code, I get something like this:

    http://www.excelfox.com/forum/f17/te...2079/#post9634

    Thanks
    Alan

    P.s. ( I realize you use php instead of BB Code Window to stop the square brackets in strings in the code causing problems )

    P.P.s when I copy your code and put it in a php window it looks OK…

    Here a bit of my code:


    PHP Code:
    Sub BB_Table_Clipboard_PikeFoxAlan() 'http://www.excelfox.com/forum/f13/bbcode-table-2077/         Dim BB_Row As Range, BB_Cells As Range, BB_Range As Range    Dim BB_Code As String, strFontColour As String, strBackColour As String, strAlign As String, strWidth As String    'Const csHEADER_COLOR As String """#FFFFFF"""    Const csHEADER_COLOR As String "black"    'Const csHEADER_BACK As String = "#888888"    Const csHEADER_BACK As String = "powderblue"    Const csROW_BACK As String = "#FFFFFF"    Set BB_Range = Selection    BB_Code = "[color=lightgrey]Using " & ExcelVersion & "[/color]" & vbCrLf 'Give Excel version    BB_Code BB_Code "[table=" """" "class:thin_grid" """" "]" vbNewLine    'BB_Code = BB_Code & "[tr][td][font=Wingdings]v[/font][/td]" & vbNewLine    BB_Code = BB_Code & "[tr=bgcolor:" & csHEADER_BACK & "][th][COLOR=" & csHEADER_COLOR & "][sub]Row[/sub]\[sup]Col[/sup][/COLOR][/th]"      ' top left cell    For Each BB_Cells In BB_Range.Rows(1).Cells 'Column Letters        strWidth = Application.WorksheetFunction.RoundUp(BB_Cells.ColumnWidth * 7.5, 0)        'BB_Code BB_Code "[td=" """" "bgcolor:#ECF0F0, align:center, width:" strWidth """" "][B]" Split(BB_Cells.Address"$")(1) & "[/B][/td]" vbNewLine        BB_Code BB_Code "[th][CENTER][COLOR=" csHEADER_COLOR "]" ColLtr(BB_Cells.Column) & "[/COLOR][/CENTER][/th]" 'Column Letter Row    Next BB_Cells 
    _................................



    Here a bit of your code from Post #3 ( Note copied here directly from the Thread Post #3 and then pasted into a php Window in this post )
    PHP Code:
    Sub BB_Table_Clipboard()
        
        
    Dim BB_Row As RangeBB_Cells As RangeBB_Range As Range
        Dim BB_Code 
    As StringstrFontColour As StringstrBackColour As StringstrAlign As StringstrWidth As String
         
        Set BB_Range 
    Selection
        BB_Code 
    "[table=" """" "class:thin_grid" """" "]" vbNewLine
        BB_Code 
    BB_Code "[tr][td][font=Wingdings]v[/font][/td]" vbNewLine
        
    For Each BB_Cells In BB_Range.Rows(1).Cells
            strWidth 
    Application.WorksheetFunction.RoundUp(BB_Cells.ColumnWidth 7.50)
            
    BB_Code BB_Code "[td=" """" "bgcolor:#ECF0F0, align:center, width:" strWidth """" "][B]" Split(BB_Cells.Address"$")(1) & "[/B][/td]" vbNewLine
        Next BB_Cells 
    _........................

    But , the same code bit of yours copied first to my the VB Editor, and then back to a php window it does not work again….

    PHP Code:
    Sub BB_Table_Clipboard()        Dim BB_Row As RangeBB_Cells As RangeBB_Range As Range    Dim BB_Code As StringstrFontColour As StringstrBackColour As StringstrAlign As StringstrWidth As String         Set BB_Range Selection    BB_Code "[table=" """" "class:thin_grid" """" "]" vbNewLine    BB_Code BB_Code "[tr][td][font=Wingdings]v[/font][/td]" vbNewLine    For Each BB_Cells In BB_Range.Rows(1).Cells        strWidth Application.WorksheetFunction.RoundUp(BB_Cells.ColumnWidth 7.50)        BB_Code BB_Code "[td=" """" "bgcolor:#ECF0F0, align:center, width:" strWidth """" "][B]" Split(BB_Cells.Address"$")(1) & "[/B][/td]" vbNewLine    Next BB_Cells 
    Last edited by DocAElstein; 01-21-2016 at 07:36 PM.

Similar Threads

  1. test bbcode
    By pike in forum Test Area
    Replies: 3
    Last Post: 05-16-2016, 03:58 AM
  2. Excluding Records of one Table from the Other Table
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-17-2013, 12:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •