PDA

View Full Version : Count texts in two colums and if no match write data



markpem
06-02-2016, 05:56 AM
Hello

I am wanting hopefully some VBA code if possible that the following can be done?

"if the current month and the previous month are not the same and then write the previous month and current month's text to an output column"

However if both months are the same it can be skipped

(Though if it's easier all can be counted (even consulting to consulting) and I can filter it out when I grab the data into a pivot table)

Many thanks for any advice


Previous Month

Current Month

Output



Consulting

Accepted

Consulting to Accepted



Consulting

Consulting




Consulting

Agreed

Consulting to Agreed



Agreed

Finalized

Agreed to Finalized

SamT
06-02-2016, 06:43 AM
Dim Cel As Range
For Each Cel in Intersect(UsedRange, Range(Previous Month Column))
If Cel.Offset(,1) <> Cel Then Cel.Offset(,2) = Cel & " to " & Cel.offset(,1)
Next