Excel Copy and Paste Issue

  • Thread starter Thread starter Joseph Cura
  • Start date Start date
J

Joseph Cura

I amsomewhat of a novice with Excel.
I have created a form and a macro to print then clear the form. What I am
trying to do is to take certain cells in this form and copy them into a
report.How do I get the data which will change each time the form is filled
to paste into the report going down the column.
 
Hu Joseph,

Try this:

Assuming the sheet with the form is named 'myForm' and you have a sheet
for reporting named 'myReport'

Sub PrintReportClear()
'
' Your print code comes here
'
If IsEmpty(Sheets("myReport").Range("A1")) Then
Sheets("myReport").Range("A1").Value = "Names"
Sheets("myReport").Range("A2").Value = _
Sheets("myForm").Range("Name").Value
Else
Sheets("myReport").Range("A1").End(xlDown).Offset(1, 0).Value =
_
Sheets("myForm").Range("Name").Value
End If
If IsEmpty(Sheets("myReport").Range("B1")) Then
Sheets("myReport").Range("B1").Value = "ZipCodes"
Sheets("myReport").Range("B2").Value = _
Sheets("myForm").Range("Zip").Value
Else
Sheets("myReport").Range("B1").End(xlDown).Offset(1, 0).Value =
_
Sheets("myForm").Range("Zip").Value
End If
'
' Your clear code comes here
'
End Sub

HTH,

Executor
 
Back
Top