Results 1 to 6 of 6

Testing

  1. #1
    alansidman's Avatar
    alansidman is offline Life @ 7100'
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,440

    Testing

    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


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,578
    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.

  3. #3
    alansidman's Avatar
    alansidman is offline Life @ 7100'
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,440
    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

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,863
    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?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,578
    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.

  6. #6
    alansidman's Avatar
    alansidman is offline Life @ 7100'
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,440
    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 = "
    " & ColLetters(rCell.Column) & "
    " & rRow.Row & "
    [COLOR=""" & strColor & """][" & strAlign & "]" & _ rCell.Text & "[/" & strAlign & "][/COLOR]
    " 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

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA for testing if checkbox is checked
    By rhewitt in forum Programming
    Replies: 0
    Last Post: 09-26-2012, 07:11 AM
  2. Testing Scores
    By helpaccess in forum Queries
    Replies: 4
    Last Post: 08-22-2011, 09:08 AM
  3. Testing Recordset for Records
    By AccessGeek in forum Programming
    Replies: 5
    Last Post: 03-22-2011, 12:26 PM
  4. Testing Task - Forms
    By collwill in forum Access
    Replies: 1
    Last Post: 03-09-2011, 10:25 PM
  5. Testing links
    By piflechien73 in forum Forms
    Replies: 0
    Last Post: 06-01-2009, 05:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums