LoginSignup
0
0

More than 5 years have passed since last update.

Qiitaで表を投稿しやすくするためにExcelの表にパイプを入れるマクロ

Posted at
Sub パイプを入れる()

  maxRow = Cells(Rows.Count, 1).End(xlUp).Row
  maxCol = Cells(1, Columns.Count).End(xlToLeft).Column

  For i = 1 To maxRow
    For j = 1 To maxCol
      Cells(i, j) = "|" & Cells(i, j).Text
      If j = maxCol Then
        Cells(i, j) = Cells(i, j).Text & "|"
      End If
    Next j
  Next i
End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0