Consulting

Results 1 to 12 of 12

Thread: Macro To Vlookup End Insert value

  1. #1

    Macro To Vlookup End Insert value

    perfect!

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Q of DETTAGLIO_CARICO is completely blank, is that correct?

  3. #3
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Ok try this:


    Option Explicit
    Sub CompareData()
    Dim x               As Long
    Dim LastRow         As Long
    Dim c               As Range
    Dim CheckValue      As Double
    Application.ScreenUpdating = False
        LastRow = Sheets("IMPAGATI").Range("D65536").End(xlUp).Row
        For x = 3 To LastRow
            CheckValue = Sheets("IMPAGATI").Range("D" & x).Value
            With Sheets("DETTAGLIO_CARICO").Range("D:D")
                Set c = .Find(What:=CheckValue, LookIn:=xlValues, LookAt:=xlWhole)
            End With
            If Not c Is Nothing Then
                Sheets("IMPAGATI").Range("L" & x).Value = _
                    Sheets("DETTAGLIO_CARICO").Range("Q" & x).Value
            End If
            Application.StatusBar = "Calculating: " & x & " of " & _
                LastRow & " < " & Format(x / LastRow, "Percent") & " > "
        Next x
        Application.StatusBar = False
        Application.ScreenUpdating = True
    End Sub

  4. #4
    But your macro delete the value in column L of IMPAGATI, i would wont ....

    if the same number IN column D OF DETTAGLIO_CARICO is present IMPAGATI copy the relative value of the column L of IMPAGATI in column Q of DETTAGLIO_CARICO

  5. #5
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    I dont really understand. Maybe you need to switch the line that changes the values. Try this:


    Option Explicit
    Sub CompareData()
    Dim x               As Long
    Dim LastRow         As Long
    Dim c               As Range
    Dim CheckValue      As Double
    Application.ScreenUpdating = False
        LastRow = Sheets("IMPAGATI").Range("D65536").End(xlUp).Row
        For x = 3 To LastRow
            CheckValue = Sheets("IMPAGATI").Range("D" & x).Value
            With Sheets("DETTAGLIO_CARICO").Range("D:D")
                Set c = .Find(What:=CheckValue, LookIn:=xlValues, LookAt:=xlWhole)
            End With
            If Not c Is Nothing Then
                Sheets("DETTAGLIO_CARICO").Range("Q" & x).Value = _
                Sheets("IMPAGATI").Range("L" & x).Value
            End If
            Application.StatusBar = "Calculating: " & x & " of " & _
            LastRow & " < " & Format(x / LastRow, "Percent") & " > "
        Next x
        Application.StatusBar = False
        Application.ScreenUpdating = True
    End Sub

  6. #6
    BIG! Sorry for my english. It work naturally...

  7. #7
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    No problem. So is this code working fine for you now or do we need to do something else?

  8. #8
    Nothing in this time many tks, tomorrow i go in vacation and you? If yor vacation time you go in Italy, to Napoli, tell me, i offer you a big pizza and a deliciuos caffe';-)

  9. #9
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Sounds good to me.

    Take Care

  10. #10
    Quote Originally Posted by DRJ
    Sounds good to me.

    Take Care
    Hi, DRJ and All...
    i am back to the vacation...
    The first choice of this day it has been to one greet to you.

  11. #11
    http://www.erlandsendata.no/download...barcontrol.zip

    My dear i have dowloded this utility (i am interessed only for StartProcessing1) and i would want to integrate in your acript, have you a time for me?

    My macro is located in modulo1

    I have re-attache my initial wbook with your modify.
    Tks

  12. #12
    Quote Originally Posted by DRJ
    No problem. So is this code working fine for you now or do we need to do something else?
    if you heva a little time for me see my last post on this discussion...
    Tks.
    Sal

Posting Permissions

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