| 
    
     |  | ある決まっているアクションをマクロに纏めましたが、いくつかの質問をさせて いただきますので、よろしくお願いします。
 
 動作1:シート全体の「セルを結合する」をOFFにする。
 動作2:行1:3を削除する。
 動作3:列A:A,D:D,E:Eを削除する。
 動作4:セルA1に「コード」、B1に「取引先名」、C1に「銀行」を入力する。
 動作5:セルE1の消費税の後ろに「(A)」を入力する。
 動作6:シート名称を変更する。
 動作7:ファイル名を付けて、保存する。
 
 質問1:Application.ScreeUpdating = False
 ・
 ・
 Application.ScreeUpdating = Treu
 画面のちらつきを抑制するため、以上のコードをいれたら、
 サポートしませんというメッセージがでています。
 解決方法はあるのでしょうか?
 質問2:VBの知識は無いため、自動登録方式で以下のコードを作りましたが、
 なんか長くて、見づらいと思います。その中に余分なコードはあり
 ますか?または簡素化できるのでしょうか?
 
 Sub Macro1()
 Application.ScreeUpdating = False
 Cells.Select
 With Selection
 .Orientation = 0
 .AddIndent = False
 .ReadingOrder = xlContext
 .MergeCells = False
 End With
 Rows("1:3").Select
 Selection.Delete Shift:=xlUp
 Range("A:A,D:D,E:E").Select
 Range("E1").Activate
 Selection.Delete Shift:=xlToLeft
 Range("A1").Select
 ActiveCell.FormulaR1C1 = "コード"
 With ActiveCell.Characters(Start:=1, Length:=3).Font
 .Name = "MS Pゴシック"
 .FontStyle = "標準"
 .Size = 9
 .Strikethrough = False
 .Superscript = False
 .Subscript = False
 .OutlineFont = False
 .Shadow = False
 .Underline = xlUnderlineStyleNone
 .ColorIndex = xlAutomatic
 End With
 Range("B1").Select
 ActiveCell.FormulaR1C1 = "取引先名"
 With ActiveCell.Characters(Start:=1, Length:=4).Font
 .Name = "MS Pゴシック"
 .FontStyle = "標準"
 .Size = 9
 .Strikethrough = False
 .Superscript = False
 .Subscript = False
 .OutlineFont = False
 .Shadow = False
 .Underline = xlUnderlineStyleNone
 .ColorIndex = xlAutomatic
 End With
 ActiveCell.Characters(1, 2).PhoneticCharacters = "トリヒキ"
 ActiveCell.Characters(3, 1).PhoneticCharacters = "サキ"
 ActiveCell.Characters(4, 1).PhoneticCharacters = "メイ"
 Range("C1").Select
 ActiveCell.FormulaR1C1 = "銀行"
 With ActiveCell.Characters(Start:=1, Length:=2).Font
 .Name = "MS Pゴシック"
 .FontStyle = "標準"
 .Size = 9
 .Strikethrough = False
 .Superscript = False
 .Subscript = False
 .OutlineFont = False
 .Shadow = False
 .Underline = xlUnderlineStyleNone
 .ColorIndex = xlAutomatic
 End With
 ActiveCell.Characters(1, 2).PhoneticCharacters = "ギンコウ"
 Range("E1").Select
 ActiveCell.FormulaR1C1 = "消費税(A)"
 With ActiveCell.Characters(Start:=1, Length:=6).Font
 .Name = "MS Pゴシック"
 .FontStyle = "標準"
 .Size = 9
 .Strikethrough = False
 .Superscript = False
 .Subscript = False
 .OutlineFont = False
 .Shadow = False
 .Underline = xlUnderlineStyleNone
 .ColorIndex = xlAutomatic
 End With
 ActiveCell.Characters(1, 3).PhoneticCharacters = "ショウヒゼイ"
 Sheets("Sheet1").Select
 Sheets("Sheet1").Name = "支払DB"
 ChDir "C:\"
 ActiveWorkbook.SaveAs Filename:="C:\支払DB.xls", FileFormat:=xlNormal, _
 Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
 CreateBackup:=False
 Application.ScreeUpdating = Treu
 End Sub
 
 
 |  |