Help with macro

[Closed]
Report
-
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
-
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 reply

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