- 日志
- 好友
- 卖家信用
- 买家信用
- 注册时间
- 2009-10-15
- 在线时间
- 小时
|
50元气
「プロシージャサンプル1」のプログラムコードにコメント文をつけて、YeStudyの解答欄にコードをまるごとコピー&ペーストして提出する。 コメント文は1行ごとにつける、ただし下記の行にはつけなくてもよい。
- Sub ..... & End Sub
- With ..... & End With ただし、with で何のオブジェクトをまとめているかがわかるようにコメントを書くこと。
ヒント:
- 基本的には、英単語の意味から推測できます。
- 表を書くマクロなので、ほとんどが表のプロパティを設定するコマンドです。
- Setステートメント --> 教科書 p.169 (基本的には変数への代入です)
- Selction --> 教科書 p.125
- Weight 罫線の太さを表すプロパティ
- ウェブで検索してみるのもお勧め (検索例: Excel VBA わからない単語)
- できるかぎり詳しく、あいまいにならない表現で書くこと。
- コメント文は、対応する行の下に、改行して書くこと。行の先頭には、コメントのマーク「'」 を入れること。
- 友人と協力してやった場合、協力した友人の学生番号と名前を最後に書いておくこと。
Sub 日程表()
MsgBox ("これから日程表を作成します")
Set ws1 = Worksheets("sheet1")
ws1.Activate
With ws1
.Range("b4") = "2012/10/29"
.Range("b5") = "月曜日"
.Range("b4:b5").Select
End With
Selection.AutoFill Destination:=Range("b4:n5")
ws1.Columns("b:n").EntireColumn.AutoFit
With ws1
.Range("a5") = "時限"
.Range("a6") = "1"
.Range("a7") = "2"
.Range("a6:a7").Select
End With
Selection.AutoFill Destination:=Range("a6:a12")
ws1.Range("a5:a12").Font.Size = 15
ws1.Range("a4:n12").Select
With Selection.Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 14
End With
With Selection.Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 14
End With
With Selection.Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 14
End With
With Selection.Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 14
End With
ws1.Range("a5:n5").Select
With Selection.Borders(xlBottom)
.LineStyle = xlDouble
End With
ws1.Range("a4:a12").Select
With Selection.Borders(xlRight)
.LineStyle = xlDouble
End With
ws1.Range("a4:n12").BorderAround Weight:=xlThick, ColorIndex:=14, _
LineStyle:=xlContinuous
With ws1
.Range("a4:n12").HorizontalAlignment = xlHAlignCenter
.Range("a4:a12").RowHeight = 40
.Range("a5:a12").Interior.ColorIndex = 4
.Range("b4:n5").Interior.ColorIndex = 15
.Range("b6:n12").Interior.ColorIndex = 40
.Range("a4").Activate
End With
End Sub
|
|