LoginSignup
0
0

More than 5 years have passed since last update.

プロシージャテスト

Last updated at Posted at 2018-04-07

Sub テスト()

'指定列でセルブランクであれば0に置換

Range("AO:AO,AQ:AQ,AS:AS,AU:AU,AW:AW,AY:AY").Select
Selection.Replace What:="", Replacement:="0"

'不要行(A列ブランク以降行)を削除 ※)10000行まで

  Dim 最終行 As Long
  最終行 = Cells(Rows.Count, 1).End(xlUp).Row + 1
  Range(最終行 & ":10000").Delete

'デスクトップPATHを取得

  Dim Path As String, WSH As Variant
  Set WSH = CreateObject("WScript.Shell")
  Path = WSH.SpecialFolders("Desktop") & "\"
    Application.DisplayAlerts = False 'アラートウィンドウ機能停止

'csv形式でファイルをデスクトップPATHに保存

  ActiveWorkbook.SaveAs Path & "テスト" & Format(Date, "yymmdd") & ".csv", _
  FileFormat:=xlCSV, Local:=True

'ファイルクローズ

 Application.Quit
  ThisWorkbook.Close
    Application.DisplayAlerts = True 'アラートウィンドウ機能再開

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