Gerasimos_Zap
New Member
- Joined
- Sep 23, 2015
- Messages
- 20
I have a script that loops through sections on one sheet (Function Test Procedure) and pastes those values into another sheet (Results) in cell L2. The way it is currently set up is to loop for the number of sections, copy and paste those values to the Results sheet and select the next empty cell in column L. That works just fine, as long as the button is not pressed multiple times. When the button is pressed multiple times, it will add the copied results under the results that were already there. What I want to do is modify the script to loop through the available sections and then select cell L2 to paste the updated results over the existing results if the button is pressed numerous times. This should be simple, but I cannot figure it out.
Code:
Sub Copy_ATP_Tables()
Dim SectionATP As Long, NextRow As Long
For SectionATP = 1 To 35 '36
NextRow = Sheets("Results").Range("L" & Rows.Count).End(xlUp).Row + 1 'Next empty row
Sheets("Acceptance Test Procedure").Range("APTSec" & SectionATP).Columns("A:H").Copy _
Destination:=Sheets("Results").Range("L" & NextRow) 'SpecialCells(xlCellTypeVisible)
' Range("FTPSec" & Section).Columns("G:H").SpecialCells(xlCellTypeVisible).Copy _
' Destination:=Sheets("Results").Range("N" & NextRow)
Next SectionATP
' Sheets("Results").Range("ATPResults").Select
' For SectionATP = 35 To 35
End Sub