'How do I automatically select a different cell when the user enters a value?
I have formatted a worksheet to need input in only specific cells. I'm wondering if it is possible to add VBA code such that when the user enters a value in cell A5 that the code automatically selects G5. When the user enters a value in G5, the code should automatically select A6.
Solution 1:[1]
You need to put a small bit of VBA code in the worksheet module of the worksheet you want to behave in this manner.
Open up the Visual Basic Editor and double-click the name of the worksheet you are interested in modifying under "Microsoft Excel Objects" As seen here:
Then paste in the following code so the module appears as in the picture. The "Option Explicit" directive at the top is optional.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then Range("G5").Select
End Sub
This code says: When ever a change is made to the worksheet, if the cell changed was "A5" then select G5
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gove |

