Results 1 to 4 of 4
  1. #1
    KrishnaSiva is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2018
    Posts
    4

    Load Excel comments to Ms Access table as a seperate field

    Hi Team,



    We have a excel file with 6 columns, out of this 4 columns has the comments .

    Now i am trying to import the Excel data to access, when i import i am able to import all the 6 columns but i have a requirement to capture the comments of 4 excel columns and load in to access table as different fields. So finally in excel there should be 10 fields( 6 Excel Columns+ 4 Comments).

    It's a bit urgent issue, please help to respond ASAP.

    Regards,
    Siva

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Can't you just import all columns using :
    Docmd.transferspreadsheet?

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    You will have to use Excel automation to do that or you can edit your Excel file to convert the comments to cell content using one of the methods below:
    https://www.extendoffice.com/documen...-to-cells.html
    https://chandoo.org/wp/2009/09/03/get-cell-comments/
    https://www.howtoexcel.org/vba/how-t...book-with-vba/

    Cheers,
    Vlad

  4. #4
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    Excel function with error handling:

    Code:
    Public Function getComment(rCell As Range) As String
    On Error GoTo Err_getComment
        Dim strComment As String
            
        strComment = rCell.Comment.Text
        getComment = strComment
        
    Exit_getComment:
        Exit Function
        
    Err_getComment:
        If Err.Number = 91 Then
            getComment = ""
        Else
            getComment = Err.Number & ": " & Err.Description
            Resume Exit_getComment
        End If
            
    End Function

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

Similar Threads

  1. Replies: 1
    Last Post: 08-03-2016, 05:00 PM
  2. Replies: 6
    Last Post: 04-09-2015, 08:57 PM
  3. Replies: 9
    Last Post: 02-02-2015, 01:03 PM
  4. Load excel to access database
    By Rajesh in forum Programming
    Replies: 7
    Last Post: 01-03-2014, 11:44 AM
  5. Replies: 3
    Last Post: 08-26-2011, 12:11 PM

Tags for this Thread

Posting Permissions

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