An active cell, also known as a cell pointer or selected cell, refers to a cell in the Excel spreadsheet that is currently selected. Typically, an active cell has a thick border around it.
Each cell in Excel has a unique address which is denoted by a column letter and row number.
Note: In the example, the letter (C) refers to the Columns while the number (7) represents the Rows.
A worksheet in Excel contains around 17 billion cells and the last cell in the worksheet has the address XFD1048576. Here, XFD is the Column letter whereas 1048576 is the Row number.
Changing the Active Cell in Excel
In order to change the active cell, you can use the Arrow keys (Up, Down, Left, and Right) on your keyboard or left-click to jump into any cell.
If you hit the Right Arrow key, the active cell will move to the right of the current active cell.
The address of the currently active cell is shown in the Name Box in the top-left corner.
Selecting Multiple Cells as Active Cells
Generally speaking, you can select multiple cells in a spreadsheet, however, there can be only one active cell at a time. Here, although we’ve chosen multiple cells (B5:D9), only the B5 cell is active.
Steps:
- Select a range of cells, here, we’ve selected the B5:D9 cells.
- Type in a text or any value in the Formula Bar.
- Press the Ctrl + Enter keys on your keyboard. This auto-fills the values or formulas across the range.
The result should look like the image shown below.
Formatting the Active Cell in Excel
Enter Edit Mode:
- Press the F2 key or double-click the left button on the mouse to enter into Edit Mode.
- Type in a value or text and press the Enter key.
Method 1 – Using the Format Cells Dialog Box
Consider the List of Company Stock Prices dataset shown in the B4:D13 cells. The dataset shows the Company name, its Ticker, and the Stock Price, respectively.
We want to format the Stock Price column to show the prices in USD.
Steps:
- Select the D5:D13 cells.
- Right-click and choose Format Cells.
This opens the Format Cells dialog box.
- Click the Number tab.
- In the Currency section, select 2 Decimal places and hit OK.
This formats the Stock Prices in the USD.
Method 2 – Using Keyboard Shortcuts
Steps:
- Select the D5:D13 cells.
- Press Ctrl + 1.
This opens the Format Cells wizard.
- Format as Currency with 2 decimal places.
This formats the Stock Prices in USD as shown in the image below.
Method 3 – Applying a VBA Macro Tool
Steps:
- Navigate to the Developer tab and click the Visual Basic button.
This opens the Visual Basic Editor in a new window.
- Go to the Insert tab and select Module.
- Copy the code from here and paste it into the window as shown below.
Sub Format_Cell()
Worksheets("Sheet1").Activate
Range("D5:D13").Select
Selection.NumberFormat = "$#,##0.0"
End Sub
⚡ Code Breakdown:
- In the first portion, the sub-routine is given a name, here it is Format_Cell().
- The ActiveSheet property activates the worksheet, in this case, Using VBA Code.
- Range.Select method specifies the column that you want to format.
- Enter the NumberFormat property to get the result in USD.
- Close the VBA window and click the Macros button.
This opens the Macros dialog box.
- Select the Format_Cell macro and hit the Run button.
The output should look like the picture shown below.
How to Make A1 the Active Cell in Excel
Steps:
- Insert the following code in a VBA module (see Method 4 above).
Sub Make_A1_Active()
Dim wksht As Worksheet
For Each wksht In ThisWorkbook.Worksheets
Application.Goto reference:=wksht.Range("A1"), scroll:=True
Next wksht
End Sub
⚡ Code Breakdown:
- The sub-routine is given a name, here it is Make_A1_Active().
- We defined the variable wksht.
- A For-Next statement will loop through all the worksheets and jump to the A1 cell using the Range property.
- Close the VBA window and click the Macros button.
This opens the Macros dialog box.
- Select the Make_A1_Active macro and hit the Run button.
Your result should look like the image shown below.
Read More:
Highlighting the Active Cell with Excel VBA Code
Steps:
- Open the VBA editor.
- Double-click on Sheet6 (Highlight Active Cell) shown in the image below.
- Select the Worksheet option, copy the code from here, and paste it into the window.
In the code shown below, the ActiveCell property stores the Address of the active cell in the G4 cell.
Private Sub Highlight_Active_Cell(ByVal Target As Range)
Range("G4").Value = ActiveCell.Address
End Sub
- Exit the Visual Basic Editor and you’ll see that the G4 cell shows the address of the active cell.
- Select the A1 cell, then click the Select All button (step 2).
- Click the Conditional Formatting option and select New Rule.
The New Formatting Rule wizard pops up.
- Choose the Use a formula to determine which cells to format option.
- In the Rule Description, enter the following formula.
=ADDRESS(ROW(A1),COLUMN(A1))=$G$4
- Click on the Format box to specify the cell color.
This opens the Format Cells wizard.
- Click the Fill tab and choose a color of your liking. We’ve chosen the Bright Yellow color.
- Hit the OK button.
The active cell will be highlighted and its address will be shown in the G4 cell.
Download the Practice Workbook
Related Articles
- How to Show All Text in an Excel Cell
- How to Delete a Cell in Excel
- How to Grey Out Unused Cells in Excel
- How to Edit Cell in Excel with Keyboard
<< Go Back to Excel Cells | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!