0

I have done some searching and found a similar question with some helpful code.

Excel Macro - Select all cells with data and format as table

The code given is

Sub A_SelectCellsWithData()
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
End Sub

However, this also selects blank rows in between the whole sheet of data.

What I need is to only select the cells with data.

i.e. In addition to the above code, omit all blank rows when selecting cells in a sheet with data.

I really can't find a solution to this question after such a long time searching online. Thank you guys!

Community
  • 1
  • 1
NewLearner
  • 149
  • 1
  • 3
  • 12
  • What you are planning to do with with these cells? If you can provide more information we might be better able to point you in the right direction. – David Rushton Jul 01 '16 at 16:20
  • 2
    Use [xlCellTypeConstants](https://msdn.microsoft.com/en-us/library/office/ff836534.aspx) with the [Range.SpecialCells method](https://msdn.microsoft.com/en-us/library/office/ff196157.aspx). –  Jul 01 '16 at 16:24

0 Answers0