質問するログイン新規登録

質問編集履歴

3

c

2016/12/13 06:07

投稿

dokoniarukana
dokoniarukana

スコア31

title CHANGED
File without changes
body CHANGED
@@ -25,7 +25,7 @@
25
25
  a(j) = Left(a(j), 2)
26
26
  Next
27
27
  'Eからみぎのセルに貼り付ける
28
- Cells(i, "E").Resize(, j).Value = b
28
+ Cells(i, "E").Resize(, j).Value = a
29
29
  Next
30
30
  Application.ScreenUpdating = True
31
31
  End Sub

2

code

2016/12/13 06:07

投稿

dokoniarukana
dokoniarukana

スコア31

title CHANGED
File without changes
body CHANGED
@@ -19,7 +19,7 @@
19
19
  '0行目から最終行まで
20
20
  For j = 0 To UBound(a)
21
21
  'もし文頭が記号から始まれば1文字のみ取る
22
- If Left(b(j), 1) = "『" Then
22
+ If Left(a(j), 1) = "『" Then
23
23
  a(j) = Left(a(j), 1)
24
24
  End If
25
25
  a(j) = Left(a(j), 2)

1

code

2016/12/13 05:04

投稿

dokoniarukana
dokoniarukana

スコア31

title CHANGED
File without changes
body CHANGED
@@ -9,20 +9,20 @@
9
9
  'D2から最終行まで探す
10
10
  For i = 2 To Cells(Rows.Count, "D").End(xlUp).Row
11
11
  'Dのテキストを格納する
12
- a = WorksheetFunction.Clean(Cells(i, "D").Text)
12
+ b = WorksheetFunction.Clean(Cells(i, "D").Text)
13
- a = Replace(a, c, "")
13
+ b = Replace(b, c, "")
14
14
  '記号の次
15
15
  For Each v In Array("。")
16
- a = Replace(a, v, c, , , vbTextCompare)
16
+ b = Replace(b, v, c, , , vbTextCompare)
17
17
  Next
18
- b = Split(WorksheetFunction.Trim(a), c)
18
+ a = Split(WorksheetFunction.Trim(b), c)
19
19
  '0行目から最終行まで
20
20
  For j = 0 To UBound(a)
21
21
  'もし文頭が記号から始まれば1文字のみ取る
22
22
  If Left(b(j), 1) = "『" Then
23
- b(j) = Left(b(j), 1)
23
+ a(j) = Left(a(j), 1)
24
24
  End If
25
- b(j) = Left(b(j), 2)
25
+ a(j) = Left(a(j), 2)
26
26
  Next
27
27
  'Eからみぎのセルに貼り付ける
28
28
  Cells(i, "E").Resize(, j).Value = b