Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

MACRO

  Asked By: Leah    Date: Feb 18    Category: MS Office    Views: 563
  

I LIKE TO CREATE A MACRO THAT SELECT ONLY THE EMPTY CELL IN RANGE A1:I9
ANY ONE CAN HELP ME WITH THIS, SINCE I AM LEARNING EXCEL

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Jana Franklin     Answered On: Feb 18

Try this one.

Sub SelEmpty()
Dim EmptyCells, MyCell As Range
Dim First As Boolean
First = True
For Each MyCell In Range("A1:I9").Cells
If MyCell.Formula = "" Then
If First Then
Set EmptyCells = MyCell
First = False
Else
Set EmptyCells = Union(EmptyCells, MyCell)
End If
End If
Next 'MyCell
EmptyCells.Select
End Sub

 
Answer #2    Answered By: Clay Cook     Answered On: Feb 18

Sub SelEmpty2()
Range("A1:I9").SpecialCells(xlCellTypeBlanks).Select
End Sub

 
Didn't find what you were looking for? Find more on MACRO Or get search suggestion and latest updates.




Tagged: