回答編集履歴
1
より確実に文字列データとして格納されるように修正しました。
test
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
Dim rngCell As Range
|
10
10
|
Dim lngMaxLen As Long
|
11
|
+
Dim varNewValue As Variant
|
11
12
|
|
12
13
|
Application.ScreenUpdating = False
|
13
14
|
|
@@ -18,9 +19,10 @@
|
|
18
19
|
lngMaxLen = Len(CStr(WorksheetFunction.Max(.Value)))
|
19
20
|
.NumberFormat = """Y""" & String(lngMaxLen, "0")
|
20
21
|
For Each rngCell In .Cells
|
21
|
-
r
|
22
|
+
varNewValue = rngCell.Text
|
23
|
+
rngCell.NumberFormat = "@"
|
24
|
+
rngCell.Value = varNewValue
|
22
25
|
Next
|
23
|
-
.NumberFormat = "@"
|
24
26
|
End With
|
25
27
|
|
26
28
|
Application.ScreenUpdating = True
|