Skip to content

Instantly share code, notes, and snippets.

@kshimi
Created January 30, 2014 09:29
Show Gist options
  • Save kshimi/d0856f39e10a817de418 to your computer and use it in GitHub Desktop.
Save kshimi/d0856f39e10a817de418 to your computer and use it in GitHub Desktop.
Excelで選択範囲に対し、表示上空欄に見える値をクリアして本当の空欄にする
Sub Macro1()
Dim i As Long
For i = 1 To Selection.Count
If Not IsEmpty(Selection(i)) Then
If Selection(i).Value = "(NULL)" Or _
Asc(Selection(i)) = -31871 Or _
Asc(Selection(i)) = 63 Then
Selection(i).ClearContents
End If
End If
Next i
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment