Friday, October 30, 2009

Microsoft Excel Macro: Select Columns & Replace NULLS or EMPTY cells

 Sub ReplaceNulls()
'
' Replace Nulls Macro
' Macro recorded 10/29/2009 by  KayLohn

Dim MyCell As Range

Dim ing As Long

ing = Range("K1").CurrentRegion.Rows.Count

' Column in this case is K
For Each MyCell In Range("K2:K" & ing)

'If an EMPTY or NULL cell is found replace with value in this case a space
If IsEmpty(MyCell) Then Bcell = " "

Next Bcell

End Sub

No comments:

Post a Comment