Created
March 20, 2018 09:10
-
-
Save DuongAQ/8d621eb051d860a0ec2e1b052751c486 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Phan_mang_Dat_Cong_thuc() 'Đặt công thức cho các mảng bị phân tách | |
Dim lr As Long | |
Dim area As Range | |
Dim sh As Worksheet | |
Set sh = ActiveSheet | |
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row | |
'Cột thành tiền (cột E) nhân 10% thuế để ra kết quả tại cột F | |
For Each area In sh.Range("E2:E" & lr).SpecialCells(xlCellTypeFormulas).Areas | |
area.Offset(, 1).FormulaR1C1 = "=RC[-1]*10%" 'Cột F cách cột E 1 cột nên Offset(,1) | |
'RC[-1] để lấy cột trước cột kết quả 1 cột | |
Next area | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment