+ Reply to Thread
Results 1 to 1 of 1

Synchronising VBA code from excel with access database

  1. #1
    Registered User
    Join Date
    06-22-2010
    Location
    Ulm
    MS-Off Ver
    Excel 2003
    Posts
    28

    Synchronising VBA code from excel with access database

    Hello,

    I have some problem with synchronizing the VBA code from excel to work at access database.
    This code erases the last star with any characters after the star. Example: This ID CODE - 63047450201*RO*Kolis*RBBG*LIM would become THIS 63047450201*RO*Kolis*RBBG

    The problem is that I cant make it to work in access. My access database is similar to the excel data you can find in the attachment. The name of the column that needs to be changed is “Code ID”.

    Here is the VBA code that I used for Excel:

    Public Sub ProcessData()
    Dim i As Long
    Dim LastRow As Long

    With ActiveSheet

    LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row
    For i = 2 To LastRow

    .Cells(i, "C").Value2 = Left(.Cells(i, "C").Value2, InStrRev(.Cells(i, "C").Value2, "*") - 1)
    Next i
    End With

    End Sub

    Thanks for any help
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1