hoangexcell
Thành viên tiêu biểu

Bữa nay chắc hỏi lần cuối thôi, mai không đụng tới excel nữa. Nên cao nhân nào biết chỉ dùm tình huống sau nhe:
Mã:
Sub a()
dem = Application.Match("N", Range(Cells(Selection.Row, Selection.Column), Cells(Selection.Row, 47)), 0)
dem = 7 (chỉ thực hiện khi lệnh trên báo lỗi không tìm ra N)
Range(Cells(Selection.Row, Selection.Column), Cells(Selection.Row, Selection.Column + dem - 2)).Value = 12
End Sub