Data Range
A B C D 1 A A A A 2 B B B B 3 C C C C 4 D D D D 5 E E E E 6 F F F F
Data Range
A B C D 1 A A A A 2 B B B B 3 C C C C 4 D D D D 5 E E E E 6 F F F F
Testing what - how to build a table in post?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
June;
I had acquired some VBA that allows you to highlight a range in Excel and then paste into a forum. It then appears as it looks in my post. I was testing to make sure that it works in this particular forum and it does. It is strictly an excel vba. If you think that this might be confusing to the masses, feel free to delete the thread. I know it works and that is all that was important to me.
Alan
You may be satisfied that it works and I can see that it works but.... all I can see is HTML code for a table. So my question is how?
That's interesting. Want to post the code? Can move this thread over to Code Repository.
However, manual copy/paste of Excel cells will create simple table. Use the Advanced post editor to dress it up.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Here's the code:
Code:Sub CopyRngToHTML() 'developed by Marcelo, Rio Brazil Dim DataObj As Object Dim strTable As String Set DataObj = GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") Application.CutCopyMode = False strTable = RngToHTML(Selection) DataObj.SetText strTable DataObj.PutInClipboard End Sub Private Function RngToHTML(rInput As Range, Optional bHeaders As Boolean = True) As String Dim rRow As Range, rCell As Range, sReturn As String, strAux As String, strColor As String Dim strAlign As String sReturn = "" RngToHTML = "Data Range" & vbNewLine & sReturn End Function Private Function ColLetters(lCol As Long) As String With ActiveSheet.Columns(lCol) ColLetters = Left(.Address(False, False), InStr(.Address(False, False), ":") - 1) End With End Function
" & ColLetters(rCell.Column) & " " & rRow.Row & "[COLOR=""" & strColor & """][" & strAlign & "]" & _ rCell.Text & "[/" & strAlign & "][/COLOR]