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?

More than 3 years have passed since last update.

勉強メモ42_シートの内容コピーしてiniなどの環境設定ファイルをテキストで作成

Posted at

0 はじめに

シートの内容をコピーしてテキストファイル 例えばiniファイルなどの環境設定ファイルを作成する方法のメモ

1 Excelファイルのシート名と中身の内容と置き場所

置き場所
image.png
シート名と中身の内容
image.png

2 VBAのソース

image.png

Option Explicit

'Excelのシートから環境設定ファイルを作成
Sub makeIniFile()
    Dim startFilePath As String
    startFilePath = ThisWorkbook.Path & "\" & "paypaApri_shukei.ini"
    
    Worksheets("環境設定ファイル").Copy
    Application.ScreenUpdating = False
    ActiveWorkbook.SaveAs Filename:=startFilePath, FileFormat:=xlText
    ActiveWorkbook.Close
    Application.ScreenUpdating = True
    'ファイル作成終了メッセージ
    MsgBox ThisWorkbook.Path & "\" & "paypaApri_shukei.ini" & "を作成しました。"
    
End Sub

3 VBA実行時の結果

image.png
image.png
image.png

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?