Empty cell

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I need to know how to empty a cell by code


1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
many ways, depends on what you want

Range("Z1").clear
Cells(1,26).clear

the above clears value, format etc from Z1

Range("Z1").clearContents
Cells(1,26).clearContents
the above only clears value from Z1


Range("Z1") =""
Cells(1,26) = ""
Range("Z1") = vbNullString
Cells(1,26) = vbNullString

the above but a blank string in cell Z1