lundi 23 février 2015

Excel Macro: If the final characters in each row of a column is "something", then

I'm trying to concatenate two cells if certain conditions are met in one of the cells.


Specifically: If the final characters in the cells of column D = " XX " then concatenate. I've done something similar to below and get an error each time.



Sub concatenate()
Last = Cells(Rows.Count, 4).End(xlUp).Row

For i = Last To 1 Step -1

If Right(Cells(i, 4), 4) = " XX " Then
'do some stuff to concatenate'

End If

Next i

End Sub


Any help is greatly appreciated.


Aucun commentaire:

Enregistrer un commentaire