简体   繁体   中英

Simplifying code into one line in excel vba?

Here is my code:

Sub part1()
    Range("A1", Range("A1").End(xlDown)).Select
    Selection.NumberFormat = "0"
End Sub

I want to simplify it into 1 line so that it formats column A as integers. I know it's a very simple question but please help me.

Sub part1()

Range("A1", Range("A1").End(xlDown)).NumberFormat = "0"

End Sub

Selection is not needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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