Malleshg24
New Member
Hi Team,
Compare Current month File which is range ("a2") to Range("b2") ,
b2 should be previous month file of range ("A2), Thanks in advance for your help.
>>> use code - tags <<<
Compare Current month File which is range ("a2") to Range("b2") ,
b2 should be previous month file of range ("A2), Thanks in advance for your help.
A | B |
Current Month File | Previous Month File |
ABC XYZ INDIA PRIVATE LIMITED (Period = May-2020 - May-2020) | ABC XYZ INDIA PRIVATE LIMITED (Period = Apr-2020 - Apr-2020) |
>>> use code - tags <<<
Code:
Sub TEST()
Dim CurrentMonth As String
Dim PreviousMonth As String
CurrentMonth = Split(Range("a2"))(7)
PreviousMonth = Split(Range("b2"))(7)
MsgBox CurrentMonth
MsgBox PreviousMonth
'output - CurrentMonth = May-2020 compare here previous month should be Apr - 2020
'output - PreviousMonth = Apr-2020
End Sub
Last edited by a moderator: