ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Empty cells (https://www.excelbanter.com/excel-programming/390450-empty-cells.html)

anamarie30

Empty cells
 
I got a spreadsheet that in sheet1 have a list of names in a range (for
example, A31:A1000) and some of the cells are in blanks. I need to copy the
list of names to sheet2 without the empty cells. How can I do that?

Tom Ogilvy

Empty cells
 
Assume the names are constants and not produced by formula

with Worksheets("Sheet1")
.Range("A31:A1000").SpecialCells(xlconstants, _
xlTextValues).copy worksheets("sheet2").range("A1")
End With

--
Regards,
Tom Ogilvy

"anamarie30" wrote:

I got a spreadsheet that in sheet1 have a list of names in a range (for
example, A31:A1000) and some of the cells are in blanks. I need to copy the
list of names to sheet2 without the empty cells. How can I do that?



All times are GMT +1. The time now is 04:21 PM.

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