Table of Contents
Introduction/Problem Statement
Many times, we have required to find the row or column number of the active cells. In this blog, we will talk about how to find the VBA Active Cell.
Solution
1. Find Row number of the active cells.
This code will show the active row number in a message box.

Sub KDataScience_RowNumberOfActivecell() MsgBox ActiveCell.Row End Sub
2. (a) Find the column number of the active cells.
This code will show an active column number in a message box

Sub KDataScience_ColumnNumberOfActivecell() MsgBox ActiveCell.Column End Sub
2. (b) Find the column Name of the active cell.
This code will return the column name of the active cell.

Sub KDataScience_ColumnNameOfActivecell() Dim addr As String Dim ColName As String 'To Find the address of the active cell addr = ActiveCell.address 'To split the address by $ and take first element of addr ColName = VBA.Split(addr, "$")(1) End Sub
Conclusion
If you want to get (VBA active cell) column number or row number of the active cells of a worksheet then you can use any code shown above (according to one’s need).
Krishna is a Subject Matter Expert in the field of Excel and Access Automation using VBA, Data Analytics, BI Reporting, and Software Development. He has 12+ years of experience of handling and presenting Decision Oriented data to Business Leaders and executing end to end software development and Automation projects.
Great content! Super high-quality! Keep it up! 🙂