Empty range of cells

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

Guest

My sheet1 have a list of things in two ranges (A11:A50, C11:C50) and some
of the cells are empty. I need to copy the list from the two ranges to, for
example, in A1:A100 on sheet2 without the empty cells.
 
This should be close...

Sub MoveStuff()
With Sheets("Sheet2")
.Range("A1:A40").Value = Sheets("Sheet1").Range("A11:A50").Value
.Range("A41:A80").Value = Sheets("Sheet1").Range("C11:C50").Value
On Error Resume Next
.Range("A1:A80").SpecialCells(xlCellTypeBlanks).Delete xlShiftUp
On Error GoTo 0
End With
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