Hi
How do I return a value to my sub procedure from a function?
I created two functions to get the last row and column of a worksheet. However, after the function is ran, it resets to zero. How do I save the function amount?
How do I return a value to my sub procedure from a function?
I created two functions to get the last row and column of a worksheet. However, after the function is ran, it resets to zero. How do I save the function amount?
Code:
Option Explicit
Option Base 1
Dim colNm As String
Dim rowNum As Integer
Sub bu_Mapping()
Sheets("Write Sheet").Activate
Sheets("1. Voting Copy").Activate
colNm = "A": rowNum = 1
wColLastRow (colNm)
wRowLastColNum (rowNum)
End Sub
Function wColLastRow(colNm As String) As Integer
wColLastRow = Range(colNm & Rows.Count).End(xlUp).Row
End Function
Function wRowLastColNum(rowNum) As Integer
wRowLastColNum = Range(colNm & rowNum).End(xlToRight).Column
End Function