0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【VBA】任意の範囲のセルを結合(中央揃え:1行毎)

Last updated at Posted at 2025-03-08

任意のセル範囲を結合(中央揃え)にするコード。
※繰り返しのループを使用

Sub Macro1()
For e = 4 To 68
  Range("M" & e & ":O" & e).Select
  With Selection
  .HorizontalAlignment = xlCenter
  .VerticalAlignment = xlCenter
  .WrapText = False
  .Orientation = 0
  .AddIndent = False
  .IndentLevel = 0
  .ShrinkToFit = True
  .ReadingOrder = xlContext
  .MergeCells = False
  End With
  Selection.Merge
  Next
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?