Luis Diaz
asked on
Excel VBA: remove # number of characters from the last to the beginning
Hello experts,
I have the following procedure in order to remove last character.
I would like to add the following requirements.
2-Input box: "How many characters do you want to removed from the last to the beginning?"
Report in next available column the modification performed by the procedure.
If you have questions, please contact me.
I have the following procedure in order to remove last character.
I would like to add the following requirements.
Sub Remove_Last_Char()
Dim c As Range
Application.ScreenUpdating = False
For Each c In Range("A1", Range("A" & Rows.Count).End(xlUp))
If c.Value <> "" Then c.Value = Left(c, Len(c) - 1)
Next c
Application.ScreenUpdating = True
End Sub
1-Input box “Please enter the column letter in which do you want to remove last characters”2-Input box: "How many characters do you want to removed from the last to the beginning?"
Report in next available column the modification performed by the procedure.
If you have questions, please contact me.
ASKER
Thank you for this proposal.
I would like to have a single Sub procedure as I will use on a regular basis from my Personal.xlsb. Is it possible to simplify?
I would like to have a single Sub procedure as I will use on a regular basis from my Personal.xlsb. Is it possible to simplify?
No. It is much better to have the calling routine and the action function. Just put both in personal
Xlsm
Xlsm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Tested and it works. Thank you very much for your help!
Open in new window
run the SelectCol_Count macro.