Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line Feed on Controll + Enter in active Cell 1

Status
Not open for further replies.

Flo79

Technical User
Nov 12, 2002
80
US
Hi There,

I am hoping someone could help me with the following:

In Excel 2003, when editing the contents of an active cell, I would like to be able to insert a line feed character (vblf) when pressing control and enter simultaneously.

So far I've been able to create the below sub which does the same but forces the user to exit the cell, run the code, and finally continue editing the cell again:

----------------------------------------------
Sub Line_Feed()
If ActiveCell.HasFormula = False Then
ActiveCell.Value = ActiveCell.Value & vbLf
End If
End Sub
-----------------------------------------------

If I could insert a line feed by pressing control + Enter and move the cursor to the beginning of the new line all while editing the cell, I would have an ideal solution.

Any pointers would be greatly appreciated.

Cheers!

FGP

 
Why not simply educate your user to use Alt+Enter ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

I had no idea!

Thank you for that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top