I have data in Col E. I would like a macro to convert the text from row 2 onwards into proper case
Printable View
I have data in Col E. I would like a macro to convert the text from row 2 onwards into proper case
Code:Sub ConvertToProper()
Dim lng As Long
lng = Cells(Rows.Count, "E").End(xlUp).Row
Range("E2:E" & lng).Value = Evaluate("=IF(E2:E" & lng & "<>"""",PROPER(E2:E" & lng & "),"""")")
End Sub
Thanks for the help, much appreciated
You can shorten that Evaluate statement slightly by doing it this way...Code:Sub ConvertToProper()
Dim lng As Long
lng = Cells(Rows.Count, "E").End(xlUp).Row
Range("E2:E" & lng).Value = Evaluate("=IF(E2:E" & lng & "<>"""",PROPER(E2:E" & lng & "),"""")")
End Sub
Code:Sub ConvertToProper()
Dim lng As Long
lng = Cells(Rows.Count, "E").End(xlUp).Row
Range("E2:E" & lng).Value = Evaluate("IF(ROW(),PROPER(E2:E" & lng & "))")
End Sub
Hi Rick, thanks for your input-much appreciated