PDA

View Full Version : [SOLVED] Why does it start in A2 not A1?



sal21
08-03-2004, 11:41 PM
... 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

Jacob Hilderbrand
08-03-2004, 11:45 PM
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

sal21
08-04-2004, 03:14 AM
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.

Jacob Hilderbrand
08-04-2004, 03:19 AM
Here it is.

sal21
08-04-2004, 03:26 AM
tks for your patience...

Jacob Hilderbrand
08-04-2004, 03:58 AM
You're Welcome

Take Care