-
Morning Pike! :)
The Daily ( Morning ) dose of ExcelFox!,,....
Quote:
Originally Posted by
pike
Yes hard question to follow as you gave a anticipated solution .. not the problem until post 12 .. guess I just confused the issue by initially using phpBB code.
Should have been code tags with noparse
_.......
_1 ) You came in at post #11. This was a long time after the Thread was, to all intents and purposes, Solved and finished**!. At the end of the Day I am very glad you did. :) - I now see an alternative solution to posting a VBA code containing BB Code Tag strings into a Forum Thread Post. :). I am not sure if you yourself knew of, or had used, that solution until Yesterday? I did not. As far as I know not many people do. In any case I have never seen that solution. Everyone appears to use the alternative solutions of using for such codes ( codes with BB Code Strings in it ) a php or HTML Code Window. So how things developed here is one argument may be for not** having the ability to mark a Thread as solved
_2 )
Quote:
Originally Posted by
pike
you gave a anticipated solution .. not the problem until post 12 .......
Sorry Pike, but that is totally wrong. This problem ( Posting a VBA code with BB Code Strings in it ) was never the issue until you came in.
At the very start, when I came in, I addressed the actual problem, and emphasised that Posting a VBA code with BB Code Strings in it was not the issue. .......
Quote:
Originally Posted by
DocAElstein
@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 )
.........
I explained the problem there that I was addressing. When I had no reply I later gave a couple of solutions which I had found myself sometime later. They were not anticipated solutions. They were, and still are, final solutions to that problem. To re iterate ( repeat myself ) ..That problem was something else. That Problem is that if you chose to use HTML or php Code windows, then occaisionally carriage returns vanish.
_3) I think again, and really no disrespect intended, - you simply did not read the Thread through. That's fine. We are all here voluntarily, so we read, answer, as we choose. :)......At the end of the Day I have now an alternive solution to Posting a VBA code with BB Code Strings in it which is great. I will likely pass that on because, as I mentioned, not many people have twigged to that. :) I will certainly referrence you and this Thread when I pass the solution on! :)
Thanks
Alan
P.s
Orange : The problem I brought up, and finally solved myself
Blue: The Problem ( or rather issue as it was not a problem ) which you brought up ( maybe unintentionally as you had not read through and did not realise that I had brought a different problem up and then later soved it ) to which finally you gave a nice alternative solution:) (- code tags with noparse)
_.........................
P.P.s
BTW. Do you not get virus warnings when accessing this site. Seems a few people have noticed it now
ExcelFox Warning
- It is very difficult ( and risky ) for me to post here. I use an old computer that may be scraped soon so as to minimise the damage should i get infected!!
_...............................
P.P.P.s
In the unlikely event that anyone other than Me or Pike ever comes here:
If you wish to post a VBA Code that contains BB Code Strings in it into a Forum Post , there are three solutions I know about now (normal code tags with noparse ; HTML Code Tags ; php Code Tags )
_1 ) Use a normal Code Window, but include a noparse BB Code tag after the first code BB Code Tag at the start, and include an end /noparse BB Code Tag just before the Last end code BB Code Tag as follows ( Note: I using a HTML window to prevent the BB Code Tags "working"** ( which is normally what you can also use noparse BB Code Tags for - using noparse BB Code Tags would mess up in this particular example in trying to demo noparse BB Code Tags themselves!.)..)
HTML Code:
[code][noparse]Your code goes here[/noparse][/code]
_2) Use either a php or HTML Code Window ( As this prevents the BB Code Tags "working"** ).
_2a) Should you choose to use this _2) solution you may occasionally experience the vanishing carriage return problem. This was discussed from post #7 and solutions were given. The simplist is probably that of the code given in post #9 and #10. To use that you simply run that code ( which works from either VBA Word or VBA Excel, andprobably some other way i do not know!! ) just before pasting your code in. It works on what you have in the Clipboard and seems to may be "put something in" which overcomes the problem -( I am not sure what .. may be it just adds an extra cariage return which allows the editor to satisfy its desire to eat one, whilst allowing one to remain !! I found that solution by trial and error ! )
-
Hi Doc
Oh man...
Quote:
P.s. ( I realize you use php instead of BB Code Window to stop the square brackets in strings in the code causing problems )
No I just misused php tags and it should have been code tags including noparse; which lead to the confusion.
Using php or html is misguided to the intent of posting vba with BBcode tags.
Quote:
and emphasised that Posting a VBA code with BB Code Strings in it was not the issue
It really was the issue and corrected with noparse. It is the correct way to use vba and code tags and highly recommend (Most forums direction) only use php code with phpBB and Html code with HTMLBB.
The bit about
Quote:
I am not sure if you yourself knew of, or had used, that solution until Yesterday? I did not. As far as I know not many people do
was that really really necessary (deeply disappointed in you Doc) .. for examples just search on moderation posts at excel forum.
just kidding but ..needless to say you will have to ditch the guys who were amazed noparse existed and hang around me more!
any way .. if you can attach a workbook with a sample of the VBA syntax, that when copied with copy/paste in to the forum BBcode truncates .. have observed that problem from time to time .. but never been able to replicate it the result.
-
Hi Pike :)
Quote:
Originally Posted by
pike
.....
The bit about was that really really necessary (deeply disappointed in you Doc) .. for examples just search on moderation posts at excel forum.
just kidding but ..needless to say you will have to ditch the guys who were amazed noparse existed and hang around me more!
.....
The problem with a written media like the internet is that as you do not see the person writing, ( or know them ), So you "speak" them in your head when you read and build up an ( often false) impression about them or how they intend the message to come across. ( Also the Human brain can be a bit unkind here - It often builds a first impression which unfortuntely lasts. ( That is why i got banned from MrExcel. By bad luck a few Mods got totally the wrong idea about me from the start and made it their ambition to get rid of me. So amazing actually, I was there for so long. Most OPs and many very prominant Excel people loved me there. So it is there loss. But that is a seperate Theme )
As I think you may have guessed , what I said there was just a very "in passing" comment of no significance, and no disrespect intended, - I am not ever at Ozgrid, so I never would have known one way or the other if you already knew about it - so I was not making any judgement what so ever about you there! :)
I have no where near the experience of someone like you around Forums, but from my experience I would suggest that hardly anyone at MrExcel or ExcelForum has ever done anything other than using HTML or PHP for VBA codes containion BB Code Strings. ( you accepted may be ) . At least one Admin and several Mods I know ( or highly expect ) had not thought of it. ( Once again I am not talking about noparse generally, I am just here talikng about how to get over the problem of VBA codes with BB Code tags in them interferring when posted in normal Code Tags ). They probably might of had thought of it, but I think possibly that most people I think went straight to the HTML or php Window solution for VBA codes with BB Code tags in them , and just did not twig then about using Normal Code tags with no parse
Quote:
Originally Posted by
pike
..... for examples just search on moderation posts at excel forum....
I have missed the point there- you are not a moderator at Excel Forum? I have no idea what you are referring to as "moderation posts" . I am not sure I feel like trying to do such a search. I have no idea how to do such a moderation posts search. Sometime the vBulletin Search can be diffficult to navigate through and understand.
_.............
Quote:
Originally Posted by
pike
...
It really was the issue and corrected with noparse. .....
It was your issue, not mine. But that is fine. :) Glad you brought it up. :) ( It might be that had you originaly used the noparse with normal Code Windows, that I may not have brought my problem up here in this particular Thread. But I would have brought it up somewhere. So I suppose looking at in that very round about abstract sort of a way that it was the issue, sort of , but not really :rolleyes: :confused: :)
_....................
Quote:
Originally Posted by
pike
.... if you can attach a workbook with a sample of the VBA syntax, that when copied with copy/paste in to the forum BBcode truncates .. have observed that problem from time to time .. but never been able to replicate it the result.
I do not think it is very practical to take that further
because
_ 1 ) I am sitting on a sack of cement in a cold shed to use an old disregarded computer for the reasons mentioned before. ( Virus warnings )
_ 2 ) We may not be talking about the same things. I am not sure what you mean by Truncates. I am talking about carriage returns ( line breaks ) vanishing on either pasting in or subsequently when posting a Forum Post.
Also my Problem was specific to pasting into php or HTML Code Tag Windows. I have never experienced the problem when pasting into or subsequently posting using Normal BB Code Tag Windows.
It is not to do with a specific VBA syntax. I suspect it is to do with differnt forms of carriage return and linefeeds along with how different Forum Editors deal with that. If you look again from Post #7, I think you can see what I was getting at. I did, and referencced, lots of Posts for you as examples as well as repeating the experiment in this Thread.
I do not get the same results at different forums. And it changes from time to time. Recently it stopped ever happening at MrExcel where it had often happened previously. I tried to take that further there, to clarify what was going in, or what changes had been made , but unfortunately most Mods had already put me on there ignore list then.
If you use for example any codes in the Workbook I gave you it will sometimes give and sometime not give the problem. As will any code what so ever. So again what I am talking about is nothing to do with VBA syntax.
If you have time, if you read agáin from my post #7 in this Thread, then you can follow through and maybe try to repeat the experiments I did. I was still getting the problem here yesterday as I demoed in post #20 for you, as well in the other "Duplicte" posts I did for you and referrenced with a Link.
I think to solve this problem we would need to be working in the same room together for a few days , firstly to make sure we were talking about the same problem. !! :) I suspect we are not talking about the same problem here.
Alan
-
Yes I was a moderator at excel forum .. Mate your post are hard to follow .. of course noparse is commonly known at MrExcel and other forums.
Quote:
I do not think it is very practical to take that further
-
Hi Pike
Quote:
Originally Posted by
pike
.. .. Mate your post are hard to follow ......
Sorry, - was just trying to help and Clarify. :(
Thanks for all your help and info.
:cheers:
Alan
:)
-
Doc
No it is me who must apologise as
Quote:
Mate your post are hard to follow
I was pulling your chain big time to get a reaction .. I'm a compulsive stirrer and would poke a sleeping tiger with a pointy stick if I ever had the opportunity.
No need to be sorry ... A question never asked is a question answer never known .. if it wasn't for your persistence with the tags thing, it would have never been definitively solved.
Remember the sensibility check that forums are all about excel banter, be pragmatic that its just excel and there are many souls in the world fighting day to day just to live.
-
Quote:
Originally Posted by
pike
.... I was pulling your chain .. to get a reaction...
Lol.. Lol... he said in a PM to you he thought you was trolling
You certainly got a reaction. He had to keeep going back and forth refinding Posts to re referrence for you Lol. The excersize did him good.
_..........
Quote:
Originally Posted by
pike
.... would poke a sleeping tiger with a pointy stick if I ever had the opportunity....
And we thought you loved Animals going by your signatures And Avatars!. Clearly the "love" is as with another Excel Promi I will mention:
"I need a macro that is so simple it could be written with the macro recorder...." Lol ( Really just Kidding there, Ford is a nice bloke, usually...mostly... )
Now I know what you meant by Rabbiting on, Rabbit Rabbit. Poor Bunny! Lol... Lol..
_..........
Quote:
Originally Posted by
pike
...... if it wasn't for your persistence with the tags thing, it would have never been definitively solved.....
His persistance and some very detailed Threads only occaisionaly get rewarded. Or / but occaisionally reveals some intersting things. Lucky no one else is watching here.. Or you would be banned now, or maybe reported, .. by / to, the RSPCA. Lol.
_..........
Quote:
Originally Posted by
pike
... and there are many souls in the world fighting day to day just to live.
Yep, that's us. Learning computers from scratch since a couple of years was just to help try speeding up part of how he was trying to do that.
Excel got to be a combination of a distraction from that fight and a bit of a plain Addiction. Instead of asking a Dozen questions he ended up answering several Thousand, mostly in his "Detailed" Style!!!!
But that should/ must all change now
_.......
Quote:
Originally Posted by
pike
.....
Remember the sensibility check that forums are all about excel banter, be pragmatic that its just excel.......
??? Clearly some peolpe take it all a bit too seriuosly, a few quirky mods IMHO around just recently, like at MrExcel IMHO. But they do all do an amazingly great job, all voluntarily, at helping with Excel. Pitty they do not just stick to that.. but who cares, got / must do other things now
_........
Thanks for letting us know, the Daily ( Morning) Dose of ExcelFox was a bit fun....
Bye
Jacky and Alan
P.Ss
Last night he was just going to reply with
"Is you jealous?" Lol Löl. I "Moderated" him ! Lol-...:)
-
Quote:
... and would poke a sleeping tiger with a pointy stick if I ever had the opportunity.
I'd pay money to see that :)
-
cool send me your bank details and I'll arrange it
-
Hi Guys,
You two "junior" members haven't got your avatars up - I never know what's going on- What's BB code? And Hello Trevor, Jac, Doc and Pike:)
| v |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
| 52 |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
| 53 |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
| 54 |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
| 55 |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
| 56 |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
W |
| 57 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
-
How you know it me?
I can have an Avatar? Who knew!? I'd forgotten I even had a login on this forum. Only here 'cos someone said it was broke.
@Pike: I pay YOU. Send me YOUR Bank Details ... PayPal would work :)
-
Yeah, me too - I came over 'cause Doc steered me over. TMS is rather recognizable. What does BB stand for??
-
-
Intrigued ... only 8500 members, and only about 740 with any posts.
-
Testing Avatar
There you, go, I forgot about my Avatar as well.
My Wife got his up straight away, bless him :rolleyes:
EDIT: Worked.
I tell you what, they have the newest vbullitin softwäre here. hardly ever have any softwäre problems, everything works, and after getting "Hit", they cleared up the virus things in a few days, rather than a few months.. like somewhere else !
Edit:
P.s.
I Welcome you two "newbies" to Excel Fox
-
@Doc: see post #54. Not gonna be so much to fix, I would guess.
-
Only thing left to add is the font name ..but different forums have different default and available fonts ..
By adding the font name is get away form the main idea of BBcode generators being a quick and easy way to show your basic worksheet layout in a table
-
I'm feeling unfulfilled here:)
-
never mind :)
Good Night, Gentlemen.
-
there you go font name added .. but will default if the worksheet font name is not avalibale in the forum BBcode font list
Code:
Option Explicit
Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Declare Function CloseClipboard Lib "User32" () As Long
Declare Function OpenClipboard Lib "User32" (ByVal hwnd As Long) As Long
Declare Function EmptyClipboard Lib "User32" () As Long
Declare Function lstrcpy Lib "kernel32" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
Declare Function SetClipboardData Lib "User32" (ByVal wFormat As Long, ByVal hMem As Long) As Long
Public Const GHND = &H42
Public Const CF_TEXT = 1
Public Const MAXSIZE = 4096
Sub BB_Table_Clipboard()
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
Dim strFontName 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.5, 0)
BB_Code = BB_Code & "[td=" & """" & "bgcolor:#ECF0F0, align:center,width:" & strWidth & """" & "][B]" & Split(BB_Cells.Address, "$")(1) & "[/B][/td]" & vbNewLine
Next BB_Cells
BB_Code = BB_Code & "[/tr]"
For Each BB_Row In BB_Range.Rows
BB_Code = BB_Code & "[tr]"
BB_Code = BB_Code & "[td=" & """" & "bgcolor:#ECF0F0, align:center" & """" & "][B]" & BB_Row.Row & "[/B][/td]" & vbNewLine
For Each BB_Cells In BB_Row.Cells
strFontColour = objColour(BB_Cells.Font.Color)
strBackColour = objColour(BB_Cells.Interior.Color)
strAlign = FontAlignment(BB_Cells)
strFontName = BB_Cells.Font.Name
BB_Code = BB_Code & "[td=" & """" & "bgcolor:" & strBackColour & ", align:" & strAlign & """" & "][COLOR=""" & strFontColour & """][Font=""" & strFontName & """]" & IIf(BB_Cells.Font.Bold, "[B]", "") & BB_Cells.Text & IIf(BB_Cells.Font.Bold, "[/B]", "") & "[/Font][/COLOR][/td]" & vbNewLine
Next BB_Cells
BB_Code = BB_Code & "[/tr]" & vbNewLine
Next BB_Row
BB_Code = BB_Code & "[/table]"
ClipBoard_SetData (BB_Code)
Set BB_Range = Nothing
End Sub
Function objColour(strColour As String) As String
objColour = "#" & Right(Right("000000" & Hex(strColour), 6), 2) & Mid(Right("000000" & Hex(strColour), 6), 3, 2) & Left(Right("000000" & Hex(strColour), 6), 2)
End Function
Function FontAlignment(ByVal objCell As Object) As String
With objCell
Select Case .HorizontalAlignment
Case xlLeft
FontAlignment = "LEFT"
Case xlRight
FontAlignment = "RIGHT"
Case xlCenter
FontAlignment = "CENTER"
Case Else
Select Case VarType(.Value2)
Case 8
FontAlignment = "LEFT"
Case 10, 11
FontAlignment = "CENTER"
Case Else
FontAlignment = "RIGHT"
End Select
End Select
End With
End Function
Function ClipBoard_SetData(MyString As String)
Dim hGlobalMemory As Long, lpGlobalMemory As Long
Dim hClipMemory As Long, X As Long
hGlobalMemory = GlobalAlloc(GHND, Len(MyString) + 1)
lpGlobalMemory = GlobalLock(hGlobalMemory)
lpGlobalMemory = lstrcpy(lpGlobalMemory, MyString)
If GlobalUnlock(hGlobalMemory) <> 0 Then
MsgBox "Could not unlock memory location. Copy aborted."
GoTo OutOfHere2
End If
If OpenClipboard(0&) = 0 Then
MsgBox "Could not open the Clipboard. Copy aborted."
Exit Function
End If
X = EmptyClipboard()
hClipMemory = SetClipboardData(CF_TEXT, hGlobalMemory)
OutOfHere2:
If CloseClipboard() = 0 Then
MsgBox "Could not close Clipboard."
End If
End Function
-
you could add font size if you wanted to
-
Pike Fornting on a Rick Code ;)