- Tham gia
- 23/3/16
- Bài viết
- 705
- Được thích
- 52
Chào cả Nhà . Em có dùng đoạn code sau để lấy dữ liệu từ Form xuống nhưng code chạy khá chậm. Mọi người có cách nào tối giản cho Nhanh giúp mình. Mình xin chân thành cảm ơn
Mã:
Sub loadxuongform()
' Load Mã hàng từ Textbox
Range("a77").Value = themmoncon.MH1.Value
Range("a78").Value = themmoncon.MH2.Value
Range("a79").Value = themmoncon.MH3.Value
Range("a80").Value = themmoncon.MH4.Value
Range("a81").Value = themmoncon.MH5.Value
Range("a82").Value = themmoncon.MH6.Value
Range("a83").Value = themmoncon.MH7.Value
Range("a84").Value = themmoncon.MH8.Value
Range("a85").Value = themmoncon.MH9.Value
Range("a86").Value = themmoncon.MH10.Value
' Load Tên hang từ label
Range("b77").Value = themmoncon.TEN1
Range("b78").Value = themmoncon.TEN2
Range("b79").Value = themmoncon.TEN3
Range("b80").Value = themmoncon.TEN4
Range("b81").Value = themmoncon.TEN5
Range("b82").Value = themmoncon.TEN6
Range("b83").Value = themmoncon.TEN7
Range("b84").Value = themmoncon.TEN8
Range("b85").Value = themmoncon.TEN9
Range("b86").Value = themmoncon.TEN10
' Load Số lượng từ Textbox
Range("c77").Value = themmoncon.SL1.Value
Range("c78").Value = themmoncon.SL2.Value
Range("c79").Value = themmoncon.SL3.Value
Range("c80").Value = themmoncon.SL4.Value
Range("c81").Value = themmoncon.SL5.Value
Range("c82").Value = themmoncon.SL6.Value
Range("c83").Value = themmoncon.SL7.Value
Range("c84").Value = themmoncon.SL8.Value
Range("c85").Value = themmoncon.SL9.Value
Range("c86").Value = themmoncon.SL10.Value
End Sub