MS Article sıfır ekleyebilir
Range("A1").NumberFormat = "@"
metne hücrenin biçimini değiştirebilir . Excel bu nedenle, bir sayıya yalnızca 15 anlamlı basamak kaydeder ve on beşinci basamaktan sonraki basamakları sıfırlar.
Numara biçimlendirmenizi almak ve ayrıca kullanıcının yalnızca sayıları girmesini sağlamak için bunu yapabilirsiniz. A1 aralığındaki metni doğruladığınız varsayılıyor. Lütfen uygun şekilde değiştirin.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Whoa
Application.EnableEvents = False
If Not Intersect(Target, Range("A1")) Is Nothing Then
'~~> If entered text is not a number then erase input
If Not IsNumeric(Range("A1").Value) Then
MsgBox "invalid Input"
Application.Undo
GoTo LetsContinue
End If
Range("A1").Value = "'" & Format(Range("A1").Value, "000000000000000000")
End If
LetsContinue:
Application.EnableEvents = True
Exit Sub
Whoa:
MsgBox Err.Description
Resume LetsContinue
End Sub
İZLEMİNDE
Eğer kopyalayıp yapıştırmak için o zaman ilk biçimine Aralığı G11 yapmak zorunda kalırsak: Manuel METİN olarak ve sonra bu kodu
SNAPSHOT kullanmak G65536 (Sayısal Değerleri Yapıştırırken)
ANLıK (zaman Yapıştırma Sigara Sayısal Değerler)
KOD
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Whoa
Dim cl As Range
Application.EnableEvents = False
If Not Intersect(Target, Range("G11:G" & Rows.Count)) Is Nothing Then
For Each cl In Target.Cells
'~~> If entered text is not a number then erase input
If Not IsNumeric(cl.Value) Then
MsgBox "invalid Input"
Application.Undo
GoTo LetsContinue
End If
cl.Value = "'" & Format(cl.Value, "000000000000000000")
Next
End If
LetsContinue:
Application.EnableEvents = True
Exit Sub
Whoa:
MsgBox Err.Description
Resume LetsContinue
End Sub
+ 1 İyi Soru :) –