Help with macro

Closed
Cindy - 14 Jun 2009 à 15:12
Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 - 15 Jun 2009 à 08:39
Hello, I am not good with vba, but I've managed to develop the following macro, however it doesn't quite work for me. It places a value in an cell Y, based on what is in cell X. However, if there's already a value in cell Y, I don't want to to do anything.

Can anyone help? Please?

Sub Auto_Complete()

'ActiveSheet.Unprotect

Dim LR As Long


LR = Cells(Rows.Count, "T").End(xlUp).Row
With Range("U8:U" & LR)
.Formula = "=IF(T8="""","""",IF(T8=""N/A"",""N/A"",IF(T8=""SUSPENDED"","""",IF(T8=""DELETED"",""""))))"
.Value = .Value
End With

End Sub

Any suggestions are much appreciated.

1 response

Excelguru Posts 261 Registration date Saturday 11 April 2009 Status Member Last seen 21 June 2011 307
15 Jun 2009 à 08:39
Hi Cindy
Iterate from row 8 to LR and apply formula if cells(row,column).value<>""