ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I write a macro copies a column to another sheet but that . (https://www.excelbanter.com/excel-programming/322490-how-do-i-write-macro-copies-column-another-sheet-but.html)

Husker87

How do I write a macro copies a column to another sheet but that .
 
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?

R.VENKATARAMAN

How do I write a macro copies a column to another sheet but that .
 
;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.





Husker87 wrote in message
...
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?




gocush[_29_]

How do I write a macro copies a column to another sheet but that .
 
-- Assuming that your "comments" are just ordinary text (not excel comments
made with InsertComments
-- 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


"Husker87" wrote:

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?



All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com