How do I write a macro copies a column to another sheet but that .

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a column on one spreedsheet with 50 questions. Each question has a
blank cell under it to input comments. I want to copy the only the questions
that have comments (together with the comments) over to another worksheet.
How can I do this with a macro? Any ideas?
 
;one way is data-filter-autofilter-choose non blanks copy this to some other
cell or some otehr sheet. but the cells where you copy should NOT be in the
same rows as the data.
 
-- Assuming that your "comments" are just ordinary text (not excel comments
made with Insert>Comments
-- Assuming that your 50 questions + 50 blank cells are in cells A1 to A100
-- Assuming you want to copy to Sheet2

Sub CopyQuestionAndComments()

Dim i as Integer

For i = 1 to 99 Step 2
If Cells(i,1).Offset(1,0)<>"" then
Range(Cells(i,1), Cells(i,1).Offset(1,0).copy _
Destination:=Sheets("Sheet2").Range("A65536").End(xlUp)
End If
Next i

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top