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

Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

TIA,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Code equivalent to the Enter-Key

Sendkeys "~"
or
sendkeys "{enter}"

or do you mean

vbCrLf

--
Regards,
Tom Ogilvy


"JMay" wrote in message
news:c45sc.4129$zE6.3489@lakeread06...
Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

TIA,




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Code equivalent to the Enter-Key

Hi
have a look at the Sendkeys method in the VBA help

--
Regards
Frank Kabel
Frankfurt, Germany


JMay wrote:
Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

TIA,

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code equivalent to the Enter-Key

Thanks Tom;
Actually here is my code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
<<<<<<<< SendKeys ("{Enter}") My requested way of completing
the Macro. See below
End Sub

When I double-click on say A5 the Check mark appears but my cursor is
"sitting, waiting and blinking" one character
to the right, as if the value has not been entered.. That is why I was
asking for the above, so as to complete the assignment
of the value to the cell A5.




"Tom Ogilvy" wrote in message
...
Sendkeys "~"
or
sendkeys "{enter}"

or do you mean

vbCrLf

--
Regards,
Tom Ogilvy


"JMay" wrote in message
news:c45sc.4129$zE6.3489@lakeread06...
Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

TIA,






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Code equivalent to the Enter-Key

Private Sub Worksheet_BeforeDoubleClick( _
byVal Target As Range, Cancel As Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
Cancel = True
End Sub


setting cancel to True will solve that problem.

--
regards,
Tom Ogilvy


"JMay" wrote in message
news:eu5sc.4187$zE6.3864@lakeread06...
Thanks Tom;
Actually here is my code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
<<<<<<<< SendKeys ("{Enter}") My requested way of

completing
the Macro. See below
End Sub

When I double-click on say A5 the Check mark appears but my cursor is
"sitting, waiting and blinking" one character
to the right, as if the value has not been entered.. That is why I was
asking for the above, so as to complete the assignment
of the value to the cell A5.




"Tom Ogilvy" wrote in message
...
Sendkeys "~"
or
sendkeys "{enter}"

or do you mean

vbCrLf

--
Regards,
Tom Ogilvy


"JMay" wrote in message
news:c45sc.4129$zE6.3489@lakeread06...
Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

TIA,










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Code equivalent to the Enter-Key

JMay,

Try this

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
With Target
If .Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
.Font.Name = "Marlett"
If .Value = vbNullString Then
.Value = "a"
Else
.Value = vbNullString
End If
Cancel = True
End If
End With
End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JMay" wrote in message
news:eu5sc.4187$zE6.3864@lakeread06...
Thanks Tom;
Actually here is my code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
<<<<<<<< SendKeys ("{Enter}") My requested way of

completing
the Macro. See below
End Sub

When I double-click on say A5 the Check mark appears but my cursor is
"sitting, waiting and blinking" one character
to the right, as if the value has not been entered.. That is why I was
asking for the above, so as to complete the assignment
of the value to the cell A5.




"Tom Ogilvy" wrote in message
...
Sendkeys "~"
or
sendkeys "{enter}"

or do you mean

vbCrLf

--
Regards,
Tom Ogilvy


"JMay" wrote in message
news:c45sc.4129$zE6.3489@lakeread06...
Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

TIA,








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code equivalent to the Enter-Key

Much appreciated, Tom
JMay

"Tom Ogilvy" wrote in message
...
Private Sub Worksheet_BeforeDoubleClick( _
byVal Target As Range, Cancel As Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
Cancel = True
End Sub


setting cancel to True will solve that problem.

--
regards,
Tom Ogilvy


"JMay" wrote in message
news:eu5sc.4187$zE6.3864@lakeread06...
Thanks Tom;
Actually here is my code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
<<<<<<<< SendKeys ("{Enter}") My requested way of

completing
the Macro. See below
End Sub

When I double-click on say A5 the Check mark appears but my cursor

is
"sitting, waiting and blinking" one character
to the right, as if the value has not been entered.. That is why I was
asking for the above, so as to complete the assignment
of the value to the cell A5.




"Tom Ogilvy" wrote in message
...
Sendkeys "~"
or
sendkeys "{enter}"

or do you mean

vbCrLf

--
Regards,
Tom Ogilvy


"JMay" wrote in message
news:c45sc.4129$zE6.3489@lakeread06...
Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

TIA,










  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Code equivalent to the Enter-Key

Nice Bob;
Tks,
JMay

"Bob Phillips" wrote in message
...
JMay,

Try this

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
With Target
If .Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
.Font.Name = "Marlett"
If .Value = vbNullString Then
.Value = "a"
Else
.Value = vbNullString
End If
Cancel = True
End If
End With
End Sub



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JMay" wrote in message
news:eu5sc.4187$zE6.3864@lakeread06...
Thanks Tom;
Actually here is my code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
<<<<<<<< SendKeys ("{Enter}") My requested way of

completing
the Macro. See below
End Sub

When I double-click on say A5 the Check mark appears but my cursor

is
"sitting, waiting and blinking" one character
to the right, as if the value has not been entered.. That is why I was
asking for the above, so as to complete the assignment
of the value to the cell A5.




"Tom Ogilvy" wrote in message
...
Sendkeys "~"
or
sendkeys "{enter}"

or do you mean

vbCrLf

--
Regards,
Tom Ogilvy


"JMay" wrote in message
news:c45sc.4129$zE6.3489@lakeread06...
Awhile back I had the [VBA]code line for the
keyboard equivalent of pressing the ENTER Key;
Can someone supply,
Maybe this time I can file it better
so that I can access it six months from now..

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
What's the vba code equivalent for Countif NDBC Excel Discussion (Misc queries) 3 July 4th 09 11:42 AM
Creating the equivalent of a "hash code" for a workbook AMADHA Excel Discussion (Misc queries) 3 December 19th 07 09:04 AM
Word equivalent of Excel code Mohan[_2_] Excel Programming 1 March 3rd 04 04:47 PM
VBA equivalent to "Return/Enter" Key JMay Excel Programming 7 October 8th 03 11:54 AM


All times are GMT +1. The time now is 09:14 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"