[ 初めての方へ | 一覧(最新更新順) | 全文検索 | 過去ログ ]
『複数の行に挿入する方法』(かず)
A列に「*」がある行のみ、行挿入を一度にする方法はありませんか。
現在は、CTRL+「+」で行挿入をしていますが、100行くらいあるので、マクロなど、簡単に行挿入する方法はないでしょうか。
ご教授いただけると幸いです。
A A
1 * 1 *
2 * 2
3 3 *
4 * ⇒ 4
5 5
6 6 *
7 * 7
8 * 8
9
10 *
11
12 *
< 使用 Excel:Excel2013、使用 OS:Windows10 >
Sub test() Dim i As Long For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 With Cells(i, 1) If .Value = "*" Then .Offset(1).EntireRow.Insert xlDown End With Next i End Sub (xxx) 2021/09/06(月) 07:13
(かず) 2021/09/08(水) 13:51
(もこな2 ) 2021/09/08(水) 14:08
Sub test()
Dim i As Long For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1 With Cells(i, 1) If .Value = "*" Then .Offset(1).EntireRow.Insert xlDown End With Next i End Sub (かず) 2021/09/08(水) 15:06
With Cells(i, 1) .Offset(1).EntireRow.Insert
(もこな2 ) 2021/09/08(水) 16:58
[ 一覧(最新更新順) ]
YukiWiki 1.6.7 Copyright (C) 2000,2001 by Hiroshi Yuki.
Modified by kazu.