質問編集履歴
3
ソース修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
endrow1 = ws2.cells(rows.count,"A").end(xlup).row
|
70
70
|
|
71
|
-
newrow =ws.cells(rows.count,"A").end(xlup).row + 1
|
71
|
+
newrow = ws.cells(rows.count,"A").end(xlup).row + 1
|
72
72
|
|
73
73
|
|
74
74
|
|
2
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
endrow1 = ws2.cells(rows.count,"A").end(xlup).row
|
70
70
|
|
71
|
-
newrow =cells(rows.count,"A").end(xlup).row + 1
|
71
|
+
newrow =ws.cells(rows.count,"A").end(xlup).row + 1
|
72
72
|
|
73
73
|
|
74
74
|
|
1
ソースを修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,35 +54,39 @@
|
|
54
54
|
|
55
55
|
|
56
56
|
|
57
|
+
Set ws = ThisWorkbook.Worksheets("sheet1")
|
58
|
+
|
57
59
|
set ws1 = workbooks(fname).worksheets("sheet1")
|
58
60
|
|
59
61
|
set ws2 = workbooks(fname).worksheets("sheet2")
|
60
62
|
|
61
63
|
|
62
64
|
|
65
|
+
|
66
|
+
|
63
67
|
endrow = ws1.cells(rows.count,"A").end(xlup).row
|
64
68
|
|
69
|
+
endrow1 = ws2.cells(rows.count,"A").end(xlup).row
|
70
|
+
|
65
|
-
newrow =cells(rows.count,"A").end(xlup).row+1
|
71
|
+
newrow =cells(rows.count,"A").end(xlup).row + 1
|
66
72
|
|
67
73
|
|
68
74
|
|
69
|
-
ws1.
|
75
|
+
ws1.Range("A2:A" & endrow1).copy
|
70
76
|
|
71
|
-
ws
|
77
|
+
ws.Range("A" & newrow).pastespecial paste:=xlpastevalues
|
72
78
|
|
73
|
-
range("A" & newrow).pastespecial paste:=xlpastevalues
|
74
|
-
|
75
|
-
|
79
|
+
Application.CutCopyMode = False
|
76
|
-
|
77
|
-
Range("A1").select 'これを入れてみても貼り付け選択範囲が解除されない
|
78
80
|
|
79
81
|
|
80
82
|
|
81
|
-
ws2.
|
83
|
+
ws2.Range("C2:C" & endrow1). Copy
|
82
84
|
|
83
|
-
|
85
|
+
’ここで、A列の最終行+1から貼付けたいのですが、デバックでみてみるとnewrowに2が入っていて
|
84
86
|
|
87
|
+
A2から貼りついてしまう。
|
88
|
+
|
85
|
-
Range("A" & newrow).PasteSpecial paste:=xlpastevalues
|
89
|
+
ws.Range("A" & newrow).PasteSpecial paste:=xlpastevalues
|
86
90
|
|
87
91
|
Application.CutCopy Mode = false
|
88
92
|
|