Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hello, currently i have the following which populates in column O the latest quarter and year from a range of dates in columns K-M
LR = Range("a" & Rows.Count).End(xlUp).row
Range("o2").Select
ActiveCell.FormulaR1C1 = "=""q"" & ROUNDUP(MONTH(MAX(RC[-4]:RC[-2]))/3,0)&""-""&YEAR(MAX(RC[-4]:RC[-2]))"
Range("O2").Copy
Range("o2" & LR).PasteSpecial xlPasteAll
Application.CutCopyMode = False
What i would really like to do is amend this , so if the result of the formula equals daterng4 it returns "0" instead of quarter and year.
I already haveDaterng4 set up for other coding.
Daterng4 = Worksheets("homepage").Range("R1") 'current quarter'
Is this possible? , any help apprciated.
LR = Range("a" & Rows.Count).End(xlUp).row
Range("o2").Select
ActiveCell.FormulaR1C1 = "=""q"" & ROUNDUP(MONTH(MAX(RC[-4]:RC[-2]))/3,0)&""-""&YEAR(MAX(RC[-4]:RC[-2]))"
Range("O2").Copy
Range("o2" & LR).PasteSpecial xlPasteAll
Application.CutCopyMode = False
What i would really like to do is amend this , so if the result of the formula equals daterng4 it returns "0" instead of quarter and year.
I already haveDaterng4 set up for other coding.
Daterng4 = Worksheets("homepage").Range("R1") 'current quarter'
Is this possible? , any help apprciated.