vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   BB Code Enhancements - BB Code [table] (https://vborg.vbsupport.ru/showthread.php?t=107985)

War.Frog 10-20-2009 04:33 PM

Quote:

Originally Posted by BRotondi (Post 1902539)
Still did not work in 2007 because the simple copy now adds some differen CRs -> you would need to paste it as text only (through Notepad or in simple Editor mode)

I solved this and reduzed the 50 lines to "auto" in the attached version. Does it work on 2002?

Regards, Bruno

Quote:

Originally Posted by MagicThemeParks (Post 1902540)
Great work guys, keep at it! :up:

If you can get a true, glitch-free option for bringing the info straight over from Excel, then it would take this mod to the stratosphere! :D

Really nice fix Bruno! I've taken a different approach here entirely, and I may need to lean on someone's VBA expertise as well, but I'm REALLY happy with the potential of v2.0. I should have a working version later this aft.

War.Frog 10-20-2009 07:31 PM

1 Attachment(s)
Based on the code of Excel2BBTable, I added some significant modification and conversions to make it work with this hack.

Now, Excel formatting as seen on screen is automatically translated on a cell-by-cell basis. So font, font color, bold, italic, underline...pretty much all the basic styling this hack supports! I would like to add colspan support...and that'll be a work in progress.

To run, just create any data here and format it the way you like. Select the range you want as a table, click on the button (or toolbar) and generate the code for pasting to your post.

One minor issue...because of how this hack is written, it adds an extra column because of the pipe "|" at the end of the rows. To remove that column, you can just delete the end pipe in the first row before you submit your post.

MagicThemeParks 10-20-2009 10:11 PM

War.Frog, this should be released as an "add-on" modification to this mod or something. This is a HUGE help for folks wanting to work on really complicated or detailed tables! :up:

Thanks for the help on this! :D

War.Frog 10-21-2009 01:22 AM

Thanks MTP! You're welcome, and I was motivated myself because I just get overwhelmed when the table exceed three rows. :D

This approach definitely eases things because it's a virtual WYSIWYG translation to BB Code. In fact, the macro could be used on ANY Excel range in any table (not just this one), as long as you manually entered the "head", sort and other detail into the code after the fact.

I'm going to continue playing with it to see if I can get colspan to work among other things.

BRotondi 10-21-2009 05:18 AM

Big Thanks also from my side :). Works on 2007 with a small "Bug":
- Header has CRs after each cell:
Quote:

[table="head;width=100%"]
a
|
b
|
c
|
and a real bug:
Code:

If iSize <> 12 Then
according the code you wanted "If iSize <> 2 Then [inserte Code-Tag]"

Nice work!! Thanks again!
Bruno

BRotondi 10-21-2009 05:45 AM

And solved the empty column on the right:
Code:

        c = 0
        c0 = rngRow.Cells.Count
        For Each rngCell In rngRow.Cells
            c = c + 1
            sCell = rngCell.Text
(...)           
            'Add opening and closing cell tags
            If c < c0 Then
                sCell = sCell & "|"
            End If

Greetings, Bruno

War.Frog 10-21-2009 09:40 AM

Awesome Bruno. Hmm, very strange about the extra CRs after the header...this is what frustrates me so much about Excel versions!

Can you try posting your fix in both .xlsx and a down-saved .xls version to see if it translates properly? I can't do anything for > 2002.

Thanks!

MagicThemeParks 10-21-2009 10:51 AM

Bruno/War.Frog,

Great work for the two of you. This is going to help our community tremendously. :up:

Does that 'empty column on the right' fix work for all versions of Excel? If so, will one of you share the 'corrected' version?

BRotondi 10-21-2009 10:54 AM

I never use xlsx, perhaps in 10 years when 2002 died :). Here always my latest xls-version in german (for my users): table.xls (Thread)

Greetings, Bruno

Edit:
  • Interesting: The CR-Bug disappeared! Perhaps has something to do with my above workaround or with multiple saving the document :).
  • Yes, should work in all Excel-Versions. I think War.Frog will soon post his new english version :)

War.Frog 10-21-2009 11:43 AM

Quote:

Originally Posted by BRotondi (Post 1903131)
I never use xlsx, perhaps in 10 years when 2002 died :). Here always my latest xls-version in german (for my users): table.xls (Thread)

Greetings, Bruno

Edit:
  • Interesting: The CR-Bug disappeared! Perhaps has something to do with my above workaround or with multiple saving the document :).
  • Yes, should work in all Excel-Versions. I think War.Frog will soon post his new english version :)

LOL Bruno...good for you not using xlsx! :D Sadly I'm stuck with 2002 because of corporate hesitation. :rolleyes:

For whatever reason, this doesn't translate well back to 2002. I'm going to look at this to try and understand why - it's now adding MORE columns to the end and a column to the beginning. C'mon Microsoft! lol.

Thanks for your nice words too MagicThemeParks. Hopefully, we can get this ironed out 100% for all versions of Excel, or at least separate ones for each.


All times are GMT. The time now is 09:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02360 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete