0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VBA(マクロ) よく使うコマンドメモ

Last updated at Posted at 2022-04-15

順次追加していきます。

セルへ入力

Cells(行番号,列番号)

Cells(1, 1) = 1

セルまたは範囲を選択

Cells(行番号,列番号).select
Range(範囲).select

Cells(1, 1).Select
Range("A1:C3").Select

途中終了

Exit Sub

Exit Sub

メッセージボックスを表示

MsgBox 内容

MsgBox "Hello World"

背景色を変更

(セルまたは範囲).Interior.Color = RGB(赤, 緑, 青)

Cells(1, 1).Interior.Color = RGB(100, 100, 100)
Range("A1:C3").Interior.Color = RGB(100, 100, 100)

フォント色を変更

(セルまたは範囲).Font.Color = RGB(赤, 緑, 青)

Cells(1, 1).Font.Color = RGB(100, 100, 100)
Range("A1:C3").Font.Color = RGB(100, 100, 100)

太字

(セルまたは範囲).Font.Bold = True

Cells(1, 1).Font.Bold = True
Range("A1:C3").Font.Bold = True

斜字

(セルまたは範囲).Font.Italic = True

Cells(1, 1).Font.Italic = True
Range("A1:C3").Font.Italic = True

上書き保存

ActiveWorkbook.Save

ActiveWorkbook.Save

【広告】

『Excelでリバーシを作ろう!! マクロ、VBAを1から学ぶ』

Excelのマクロ(VBA)で「三目並べ」「マインスイーパー」「リバーシ」を作る解説本です!
マクロ、VBAが全くわからない人でも大丈夫! 丁寧な解説と図でしっかり理解しながら楽しくプログラミングを学ぶ事ができます!
値段:300円(Kindle Unlimited対象)

サンプルとして「準備」~「三目並べ」を無料公開しています。

【kindle】

【booth(pdf】

0
3
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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?