Poorcoding
New Member
- Joined
- Feb 11, 2020
- Messages
- 4
- Office Version
- 2016
- Platform
- Windows
Hi
HELP NEEDED. I'm trying to create a macro that counts selected rows and columns and display in msgbox the total number of selected columns and rows. Here is my coding, but its running an error, see below:
Sub range_reporter()
Dim r As Range
Dim s As String
Dim nLastRow As Long, nLastColumn As Long
Dim nFirstRow As Long, nFirstColumn As Long
Set r = Selection
numrow = r.Rows.Count
MsgBox ("number of rows " & numrow)
numcol = r.Columns.Count
MsgBox ("number of columns " & numcol)
End Sub
HELP NEEDED. I'm trying to create a macro that counts selected rows and columns and display in msgbox the total number of selected columns and rows. Here is my coding, but its running an error, see below:
Sub range_reporter()
Dim r As Range
Dim s As String
Dim nLastRow As Long, nLastColumn As Long
Dim nFirstRow As Long, nFirstColumn As Long
Set r = Selection
numrow = r.Rows.Count
MsgBox ("number of rows " & numrow)
numcol = r.Columns.Count
MsgBox ("number of columns " & numcol)
End Sub