* Tóm tắt: * Biết dùng câu lệnh VBA để: - Xác định được ô, vùng ô đặc biệt: chứa công thức, chứa số, chứa text.. - Di chuyển vùng ô đang...
2. CODE MẪU THEO VIDEO:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| Sub OVungODacBiet()'' OVungODacBiet Macro'' Keyboard Shortcut: Ctrl+l''======== 1. Chon O chua CHU THICH ============ Selection.SpecialCells(xlCellTypeComments).Select'======== 2. Chon O chua SO =================== Selection.SpecialCells(xlCellTypeConstants, 1).Select'======== 3. Chon O chua TEXT =================== Selection.SpecialCells(xlCellTypeConstants, 2).Select'=======================================================' CONG THUC';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'============== 4. cong thuc cho ket qua SO ======== Selection.SpecialCells(xlCellTypeFormulas, 1).Select'============== 5. cong thuc cho ket qua TEXT ======= Selection.SpecialCells(xlCellTypeFormulas, 2).Select'============== 6. cong thuc cho ket qua LOGIC ======= Selection.SpecialCells(xlCellTypeFormulas, 4).Select'============== 7. cong thuc cho ket qua LOI ========= Selection.SpecialCells(xlCellTypeFormulas, 16).Select'========================================================' ============= 8.Chon O chua DINH DANG CO DIEU KIEN == ActiveCell.SpecialCells(xlCellTypeAllFormatConditions).Select' ============= 9.Chon O TRONG VUNG DU LIEU ============= Selection.SpecialCells(xlCellTypeBlanks).Select '=======================================================' CHON NHUNG O KHAC GIA TRI TAI 2 COT '';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Sheets("SoSanhCot").Select Range("B3:C9").Select Selection.RowDifferences(ActiveCell).Select'=======================================================' CHON NHUNG O KHAC GIA TRI TAI 2 DONG '';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Sheets("SoSanhDong").Select Range("B3:H4").Select Selection.ColumnDifferences(ActiveCell).Select'=======================================================' DI CHUYEN VUNG CHON '';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Selection.Offset(1, 0).SelectEnd Sub |