Results 1 to 3 of 3
  1. #1
    Nori is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2015
    Posts
    3

    finding the repeated value in excel column via access vba

    Hello,
    I have a excel file generated from the access which i am formatting via excel automation. Requirement is to check if each cell value is repeated in column E. If it is, then I need to clear the contents of Column C leaving the first one.(see below)

    Column C Column E
    abc 1234
    cde 678

    cde 678


    jkl 890
    abc 1234

    Final result:
    Column C Column E
    abc 1234
    cde 678

    678
    jkl 890
    1234

    Here is my attempt: I tried to use match function but it looks like it doesnot work in access.How do i achieve this?
    Code:
        lstRow2 = .Application.Cells(.Rows.Count, "E").End(xlUp).Row
          Debug.Print "lastRow:" & lstRow2
          Set .Application.frstRow = 3
          
          Do Until lstRow2 = frstRow
            If .Application.Rows("lstRow2:5") = " " Then
            lstRow2 = lstRow2 - 1
            ElseIf (Match(.Application.Cells(lstRow2, 5), "E3:ElstRow2", 0)) = "YES" Then
            .Application.Cells(lstRow2, 4).ClearContents
            lstRow2 = lstRow2 - 1
            End If
        Loop

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    I am confused. Should this question be in the excel forum?

  3. #3
    Nori is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2015
    Posts
    3
    This need to be done from access- via excel automation

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

Similar Threads

  1. Replies: 4
    Last Post: 07-28-2015, 11:20 AM
  2. Replies: 12
    Last Post: 10-08-2014, 02:35 PM
  3. Text To Column problem while getting data from access in excel
    By scorpion99 in forum Import/Export Data
    Replies: 11
    Last Post: 01-06-2014, 04:28 PM
  4. Replies: 2
    Last Post: 06-06-2012, 01:04 PM
  5. import specific column from excel to access
    By eshtul in forum Import/Export Data
    Replies: 6
    Last Post: 11-11-2011, 09:54 AM

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