Skip to content

Instantly share code, notes, and snippets.

@tadija
Created June 17, 2013 08:30
Show Gist options
  • Save tadija/5795453 to your computer and use it in GitHub Desktop.
Save tadija/5795453 to your computer and use it in GitHub Desktop.
VBA: F2 + Enter on selected cells
Sub RefreshCells()
Dim r As Range, rr As Range
Set rr = Selection
For Each r In rr
r.Select
Application.SendKeys "{F2}"
Application.SendKeys "{ENTER}"
DoEvents
Next
End Sub
@Stefa8138
Copy link

If I want to place a condition that only makes this process in the cells that have some data, how could I do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment