LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default edit cell by macro

hi all,
my problem isn't as simple as it looks from the subject of my post (at
least for me) and its continuation of a previous post.
can someone tell me if its possible to make a cell in excel sheet ready
for editing, by using a macro. that is i want to have the cursor
blinking in the cell so that i can edit the text of the cell by runnig
a particular macro.
my original issue was that i wanted to goto the next line (a line feed)
in the same cell when i press enter key. so i want to change the
defualt behaviour of the enter key, which is to goto next cell. someone
suggested using onkey method but i'm still not able to get cell in edit
mode.
my code.............

Sub testkey()
Application.OnKey "{ENTER}", "LineFeed"
End Sub

Sub LineFeed()
Dim sel As Range
Set sel = Selection
seltxt = sel.Value
withenter = seltxt & vbLf
sel.Value = withenter
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to edit formula in cell Steve Vincent Excel Discussion (Misc queries) 3 January 9th 08 12:09 AM
How can I edit cell contents with a macro in Excel? Mind the gaps! Excel Discussion (Misc queries) 2 March 23rd 05 08:51 PM
MACRO TO EDIT CELL FORMULA !! jay dean Excel Programming 3 July 10th 04 04:05 PM
A Macro to Edit Cell Content jer101 Excel Programming 2 June 17th 04 10:42 PM
Macro to edit cell steve Excel Programming 0 August 21st 03 05:48 PM


All times are GMT +1. The time now is 03:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"