วันพฤหัสบดีที่ 18 ธันวาคม พ.ศ. 2551

การใส่สีให้ช่องเซลล์ ที่ถูกเลือก ( vba and ms excel 2007 )

1. เปิด microsoft excel ขึ้นมาจากนั้น 2. จากนั้นไปที่แท็บพัฒนา แล้วนำปุ่ม commandbutton ขึ้นมา 3. เขียนโค้ดภายใต้ปุ่ม commandbutton ดั... thumbnail 1 summary
1. เปิด microsoft excel ขึ้นมาจากนั้น
2. จากนั้นไปที่แท็บพัฒนา แล้วนำปุ่ม commandbutton ขึ้นมา
3. เขียนโค้ดภายใต้ปุ่ม commandbutton ดังต่อไปนี้
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With

4. กลับมาที่ Microsoft excel แล้วกด f5 เพื่อรัน vba โค้ดที่ได้เขียนลงไป
5. ผลลัพธ์จากโค้ดเป็นดังภาพด้านล่างนี้