F2+Enter key for Macro

Closed
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Apr 17, 2016 at 10:11 AM
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 - Apr 17, 2016 at 03:42 PM
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 response

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
0
smuneeb Posts 67 Registration date Saturday September 5, 2015 Status Member Last seen March 8, 2017 1
Apr 17, 2016 at 03:42 PM
HI
RayH I've tried your given line of code, it shows the below message
Search string must be specified
0