F2+Enter key for Macro [Closed]

Report
Posts
77
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
-
Posts
77
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
-
Hi
I would like to request for a Macro that which execute a F2 and Enter keys.

Please don't make a selection for a cells.

I have a sheet where data is entered from Column D11 to D510 and it is not necessary where it ends in the subscribe range,
means that it will end to D20 or may it will end to D30.

Since I try the following code but it won't work.
Sub RefreshCell()

Dim r As Range
Dim n As Integer
Dim f As Long

f = ActiveSheet.Range("D" & Rows.count).End(xlUp).Row

Set r = Range("D11:D" & f)
r.Select
For n = 11 To r.Rows.count
    SendKeys "{F2}", True
    SendKeys "{ENTER}", True
Next n

End Sub



Thanks & Regards

1 reply

I'm not sure what you intent is or what doesn't work but use this line in place of the one you have will be a start:

For n = 1 To r.Rows.Count
Posts
77
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
1
HI
RayH I've tried your given line of code, it shows the below message
Search string must be specified