Help with macro

Closed
Cindy - Jun 14, 2009 at 03:12 PM
Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 - Jun 15, 2009 at 08:39 AM
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 April 11, 2009 Status Member Last seen June 21, 2011 307
Jun 15, 2009 at 08:39 AM
Hi Cindy
Iterate from row 8 to LR and apply formula if cells(row,column).value<>""
0