Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What's the vba code equivalent for Countif | Excel Discussion (Misc queries) | |||
Creating the equivalent of a "hash code" for a workbook | Excel Discussion (Misc queries) | |||
Word equivalent of Excel code | Excel Programming | |||
VBA equivalent to "Return/Enter" Key | Excel Programming |