回答編集履歴
2
ソース修正
answer
CHANGED
@@ -1,36 +1,46 @@
|
|
1
|
+
コメントで伺いましたが、
|
2
|
+
数式を値で上書きする処理はセルのValueに値を代入することでコピー&ペーストより高速にできますので修正してみました。
|
1
|
-
|
3
|
+
この部分とV列のところで列を挿入する処理を選択処理なしで直接行うようにしました。
|
2
|
-
不要と思った部分はシングルクォーテーションでコメント化してるので
|
3
|
-
|
4
|
+
ただV列より右列にデータが非常に多いなどするとどうしようもないかも知れないですが、試してみてください。
|
4
5
|
```VBA
|
5
6
|
Application.ScreenUpdating = False
|
6
7
|
|
8
|
+
'数式を値で上書き
|
9
|
+
Range("A2:G2").Value = Range("A2:G2").Value
|
7
10
|
'Range("A2:G2").Select
|
8
11
|
'Application.CutCopyMode = False
|
9
12
|
'Selection.Copy
|
10
13
|
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
|
11
14
|
' :=False, Transpose:=False
|
12
15
|
Rows("7:7").Select
|
13
|
-
|
16
|
+
Application.CutCopyMode = False
|
14
17
|
Selection.Copy
|
15
18
|
Rows("8:797").Select
|
16
19
|
ActiveSheet.Paste
|
20
|
+
'数式を値で上書き
|
21
|
+
Range("B7", Range("B7").SpecialCells(xlLastCell)).Value = Range("B7", Range("B7").SpecialCells(xlLastCell)).Value
|
22
|
+
Range("B7", Range("B7").SpecialCells(xlLastCell)).Replace What:="delete", Replacement:="", LookAt:=xlPart, _
|
23
|
+
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
|
24
|
+
ReplaceFormat:=False
|
17
|
-
Range("B7").Select
|
25
|
+
'Range("B7").Select
|
18
|
-
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
|
26
|
+
'Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
|
19
27
|
'Application.CutCopyMode = False
|
20
28
|
'Selection.Copy
|
21
29
|
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
|
22
30
|
' :=False, Transpose:=False
|
23
|
-
Selection.Replace What:="delete", Replacement:="", LookAt:=xlPart, _
|
31
|
+
'Selection.Replace What:="delete", Replacement:="", LookAt:=xlPart, _
|
24
|
-
|
32
|
+
' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
|
25
|
-
|
33
|
+
' ReplaceFormat:=False
|
34
|
+
'選択なしで列を挿入
|
35
|
+
Columns("V:V").Insert Shift:=xlToRight
|
26
|
-
Columns("V:V").Select
|
36
|
+
'Columns("V:V").Select
|
27
37
|
'Application.CutCopyMode = False
|
28
|
-
Selection.Insert Shift:=xlToRight
|
38
|
+
'Selection.Insert Shift:=xlToRight
|
29
39
|
Range("V7").Select
|
30
40
|
ActiveCell.FormulaR1C1 = "=IF(RC[-1]="""",""F"",RC[-1])"
|
31
|
-
|
41
|
+
Range("V7").Select
|
32
42
|
Selection.AutoFill Destination:=Range("V7:V797"), Type:=xlFillDefault
|
33
|
-
|
43
|
+
Range("V7:V797").Select
|
34
44
|
Rows("7:7").Select
|
35
45
|
Range(Selection, Selection.End(xlDown)).Select
|
36
46
|
ActiveWorkbook.Worksheets("【F】").Sort.SortFields.Clear
|
1
ソース修正
answer
CHANGED
File without changes
|