Consulting

Results 1 to 6 of 6

Thread: Why does it start in A2 not A1?

  1. #1

    Why does it start in A2 not A1?

    ... i dont undertsand, if the column A in SPORTELLI is all blank, to routine copy the records to start A2 and not in A1...

    note:
    the macro copy from sheet anagrafe column G to column A of sportelli

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


    lngTargetRow = lngTargetRow + 1
             ' Copy cells
                    Worksheets("ANAGRAFE").Range("G" & lngSourceRow).Copy _
                    Worksheets("SPORTELLI").Range("A" & lngTargetRow)

    Will add one to lngTargetRow before there is any pasting. Since lngTargetRow starts at 1, the first paste will occur at 1+1=2. To change this, paste, then add 1 to lngTargetRow.


    ' Copy cells
    Worksheets("ANAGRAFE").Range("G" & lngSourceRow).Copy _
                    Worksheets("SPORTELLI").Range("A" & lngTargetRow)
    lngTargetRow = lngTargetRow + 1

  3. #3
    Quote Originally Posted by DRJ
    This section:

    lngTargetRow = lngTargetRow + 1
             ' Copy cells
                    Worksheets("ANAGRAFE").Range("G" & lngSourceRow).Copy _
                    Worksheets("SPORTELLI").Range("A" & lngTargetRow)

    Will add one to lngTargetRow before there is any pasting. Since lngTargetRow starts at 1, the first paste will occur at 1+1=2. To change this, paste, then add 1 to lngTargetRow.


    ' Copy cells
    Worksheets("ANAGRAFE").Range("G" & lngSourceRow).Copy _
                    Worksheets("SPORTELLI").Range("A" & lngTargetRow)
    lngTargetRow = lngTargetRow + 1
    Tks, if you like re attache my project with yor modify... or send me gss.italy@iol.it
    for ever...tks.

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Here it is.

  5. #5
    tks for your patience...

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You're Welcome

    Take Care

Posting Permissions

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