giangnguyenvn19
Thành viên mới
- Tham gia
- 25/1/08
- Bài viết
- 17
- Được thích
- 3
Xin chào cả nhà, em vừa học VBA cho excel mấy hôm qua một quyển sách từ Diễn đàn của Bác Phan tự hướng, đến lúc ghi nháp một đoạn code vô và nhấn F5 nhưng bị báo lỗi không biết em gõ sai chỗ nào mong các anh chị chỉ dạy
Sub book2()
Workbook("book2.xlsx").Activate
Sheets("sheet1").Activate
Sheets("sheet1").Range("B3").Select
ActiveCell.FormulaR1C1 = "truong DH mo dia chat"
Selection.Font.Bold = True
Selection.Font.Italic = True
Selection.Font.ColorIndex = 3
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("B4").Select
End Sub
Sub book2()
Workbook("book2.xlsx").Activate
Sheets("sheet1").Activate
Sheets("sheet1").Range("B3").Select
ActiveCell.FormulaR1C1 = "truong DH mo dia chat"
Selection.Font.Bold = True
Selection.Font.Italic = True
Selection.Font.ColorIndex = 3
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("B4").Select
End Sub