PDA

View Full Version : [SOLVED:] remove . from the last of email



KAMRAN AJ
03-11-2023, 06:00 PM
Hi
Team hope you are doing great
i need a dynamimc range excel Vba code for Column k that remove just . from the last of email

JKwan
03-12-2023, 06:24 AM
give this a try

Sub RemoveDot()
Dim lRow As Long
Dim LastRow As Long

Dim WS As Worksheet

Set WS = ActiveSheet
LastRow = FindLastRow(WS, "K")
For lRow = 2 To LastRow
With WS
If Right(.Cells(lRow, "K"), 1) = "." Then
.Cells(lRow, "K") = Left(.Cells(lRow, "K"), Len(.Cells(lRow, "K")) - 1)
End If
End With
Next lRow
End Sub
Function FindLastRow(ByVal WS As Worksheet, ColumnLetter As String) As Long
FindLastRow = WS.Range(ColumnLetter & Rows.Count).End(xlUp).Row
End Function

KAMRAN AJ
03-12-2023, 07:40 AM
Excellent ,where is a button of mark as solution