简体   繁体   English

从 excel 中的列中删除非数字单元格

[英]Removing Non-numeric cells from a column in excel

I have a huge dataset in Excel with numeric and non-numeric data.我在 Excel 中有一个巨大的数据集,其中包含数字和非数字数据。 For further analysis i have to exclude all the numeric data.为了进一步分析,我必须排除所有数字数据。 An idea i had was to create a new column and divide all these cells by 1 and to use only the data with errors.我有一个想法是创建一个新列并将所有这些单元格除以 1,并仅使用有错误的数据。 However, are there any other possible ways to do so?但是,还有其他可能的方法吗?

Best regards and thanks in advance最诚挚的问候和提前致谢

This should work:这应该工作:

Sub Macro()

Dim data As Range
Dim Cel As Range

Set data = Range("[Put here the range of your datas]")

    For Each Cel In data
        If IsNumeric(Cel.Value) Then
            Cel.Value = ""
        End If
    Next Cel
    
End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM