Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,20 @@ Parse UTC date to local date.

<br>

## Last Row
Returns the last used row number for a given column.

**Required Functions**:
1. `common.getColumnLetter`

**Input**:
1. `String` Worksheet Name _(ex. "Sheet 1")_
2. `String` Search Column _(ex. "A:A")_

**Output**: `Long` Last Row Number

<br>

## Levenshtein Distance (String Metric)
This function takes two strings of any length and calculates the Levenshtein Distance between them. Levenshtein Distance measures how close two strings are by checking how many Insertions, Deletions, or Substitutions are needed to turn one string into the other. Lower numbers mean the strings are closer than high numbers. Unlike Hamming Distance, Levenshtein Distance works for strings of any length and includes 2 more operations. However, calculation time will be slower than Hamming Distance for same length strings, so if you know the two strings are the same length, its preferred to use Hamming Distance.

Expand Down
19 changes: 19 additions & 0 deletions lastRow.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'''''''''''''''''''''''''''''''''''''''''''''''
' Get Last Row In Column '
'''''''''''''''''''''''''''''''''''''''''''''''
' *** Requires Function "getColumnLetter" ***

'recieves input of worksheet (ex. "Sheet 1") and column range (ex. "A:A") as string
'outputs last used row number as long

Function lastRow(searchWorksheet As String, searchColumn As String) As Long
'dimension variables
Dim wb As Workbook: Set wb = ThisWorkbook
Dim ws As Worksheet: Set ws = wb.Sheets(searchWorksheet)

'find the column letter of the search column
Dim searchColumnLetter As String: searchColumnLetter = common.getColumnLetter(ws.Range(searchColumn).Column)

'find and return the last row in the search column
lastRow = ws.Range(searchColumnLetter & Rows.Count).End(xlUp).Row
End Function