Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default VBA equivalent to "Return/Enter" Key

I've got code that is working up to a point **and stops** -- the screen
(bottom left shows I'm in Edit Mode) - and the cursor is "inside" a cell --
all that I have to do is manually press enter and it completes. soooooo
obviously I'd like to incorporate this "last-step" in the code. Can someone
tell me what I should add to the code to have it complete the update.
TIA,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default VBA equivalent to "Return/Enter" Key

Use

Sendkeys {ENTER}
or
Sendkeys ~

See vb help using keyword sendkeys

Cheers

Joe


"JMay" wrote in message
news:USHgb.45210$AH4.15989@lakeread06...
I've got code that is working up to a point **and stops** -- the screen
(bottom left shows I'm in Edit Mode) - and the cursor is "inside" a

cell --
all that I have to do is manually press enter and it completes. soooooo
obviously I'd like to incorporate this "last-step" in the code. Can

someone
tell me what I should add to the code to have it complete the update.
TIA,




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default VBA equivalent to "Return/Enter" Key

If I understand you correctly, you are editing a cell but want VBA to then
hit enter. I don't think it can be done. Once you go into edit mode, Excel
has full control, and VBA will not resume operation until editing is
complete.

Is there a particular need to do whatever you are trying to do in this
fashion, or could you look at an alternative technique?

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in


"JMay" wrote in message
news:USHgb.45210$AH4.15989@lakeread06...
I've got code that is working up to a point **and stops** -- the screen
(bottom left shows I'm in Edit Mode) - and the cursor is "inside" a

cell --
all that I have to do is manually press enter and it completes. soooooo
obviously I'd like to incorporate this "last-step" in the code. Can

someone
tell me what I should add to the code to have it complete the update.
TIA,




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default VBA equivalent to "Return/Enter" Key

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.Font.Strikethrough = True Then
ActiveCell.Font.Strikethrough = False
Else
ActiveCell.Font.Strikethrough = True
End If
SendKeys {Enter} <<< This won't take ???
End Sub

Can you help?
TIA


"Joe 90" (remove silly spam) wrote in message
...
Use

Sendkeys {ENTER}
or
Sendkeys ~

See vb help using keyword sendkeys

Cheers

Joe


"JMay" wrote in message
news:USHgb.45210$AH4.15989@lakeread06...
I've got code that is working up to a point **and stops** -- the screen
(bottom left shows I'm in Edit Mode) - and the cursor is "inside" a

cell --
all that I have to do is manually press enter and it completes. soooooo
obviously I'd like to incorporate this "last-step" in the code. Can

someone
tell me what I should add to the code to have it complete the update.
TIA,






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default VBA equivalent to "Return/Enter" Key

Joe,

Try:
Application.SendKeys "{Enter}"
Worked for me. Win XP, XL2000

John

"JMay" wrote in message
news:w9Kgb.45612$AH4.42671@lakeread06...
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.Font.Strikethrough = True Then
ActiveCell.Font.Strikethrough = False
Else
ActiveCell.Font.Strikethrough = True
End If
SendKeys {Enter} <<< This won't take ???
End Sub

Can you help?
TIA


"Joe 90" (remove silly spam) wrote in message
...
Use

Sendkeys {ENTER}
or
Sendkeys ~

See vb help using keyword sendkeys

Cheers

Joe


"JMay" wrote in message
news:USHgb.45210$AH4.15989@lakeread06...
I've got code that is working up to a point **and stops** -- the

screen
(bottom left shows I'm in Edit Mode) - and the cursor is "inside" a

cell --
all that I have to do is manually press enter and it completes.

soooooo
obviously I'd like to incorporate this "last-step" in the code. Can

someone
tell me what I should add to the code to have it complete the update.
TIA,










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default VBA equivalent to "Return/Enter" Key

The way I read it is that when you double-click the cell, the event is
triggered so the macro is run, and then Excel puts you in edit mode. Cancel
= True takes care of the edit mode problem.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
With Target(1, 1)
.Font.Strikethrough = Not .Font.Strikethrough
End With
Cancel = True
End Sub


"JMay" wrote in message
news:w9Kgb.45612$AH4.42671@lakeread06...
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.Font.Strikethrough = True Then
ActiveCell.Font.Strikethrough = False
Else
ActiveCell.Font.Strikethrough = True
End If
SendKeys {Enter} <<< This won't take ???
End Sub

Can you help?
TIA


"Joe 90" (remove silly spam) wrote in message
...
Use

Sendkeys {ENTER}
or
Sendkeys ~

See vb help using keyword sendkeys

Cheers

Joe


"JMay" wrote in message
news:USHgb.45210$AH4.15989@lakeread06...
I've got code that is working up to a point **and stops** -- the

screen
(bottom left shows I'm in Edit Mode) - and the cursor is "inside" a

cell --
all that I have to do is manually press enter and it completes.

soooooo
obviously I'd like to incorporate this "last-step" in the code. Can

someone
tell me what I should add to the code to have it complete the update.
TIA,








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default VBA equivalent to "Return/Enter" Key

Thanks to all; I also ended up adding to a UDF SumNonStrukeThruAmts() the
line:

Application.volatile

Which makes my full procedure work great
Tks,


"Tim Zych" wrote in message
...
The way I read it is that when you double-click the cell, the event is
triggered so the macro is run, and then Excel puts you in edit mode.

Cancel
= True takes care of the edit mode problem.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
With Target(1, 1)
.Font.Strikethrough = Not .Font.Strikethrough
End With
Cancel = True
End Sub


"JMay" wrote in message
news:w9Kgb.45612$AH4.42671@lakeread06...
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.Font.Strikethrough = True Then
ActiveCell.Font.Strikethrough = False
Else
ActiveCell.Font.Strikethrough = True
End If
SendKeys {Enter} <<< This won't take ???
End Sub

Can you help?
TIA


"Joe 90" (remove silly spam) wrote in message
...
Use

Sendkeys {ENTER}
or
Sendkeys ~

See vb help using keyword sendkeys

Cheers

Joe


"JMay" wrote in message
news:USHgb.45210$AH4.15989@lakeread06...
I've got code that is working up to a point **and stops** -- the

screen
(bottom left shows I'm in Edit Mode) - and the cursor is "inside" a
cell --
all that I have to do is manually press enter and it completes.

soooooo
obviously I'd like to incorporate this "last-step" in the code. Can
someone
tell me what I should add to the code to have it complete the

update.
TIA,










Reply
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
COUNTIFS equivalent in Excel 2003 - both criteria have text, one has "wildcard" Courtney[_3_] Excel Worksheet Functions 3 April 20th 10 03:01 AM
Check if cells contain the word "Thailand", return "TRUE" ali Excel Worksheet Functions 7 September 14th 07 09:53 AM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
Make "Edit" mode default, rather than "Enter"? Greg Boettcher Excel Discussion (Misc queries) 1 July 27th 06 01:46 AM
Is there an equivalent of Lotus 123's "Paste visible" command? AJ Excel Discussion (Misc queries) 6 March 16th 06 09:21 AM


All times are GMT +1. The time now is 01:49 PM.

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"