Remove characters from left
To remove characters from the left of the selected string you need to apply a combination of Excel RIGHT and LEN functions
Example: Remove characters from left
SubRemove_characters_from_left()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'apply the formula to remove four characters from the left
ws.Range("D5") = Right(ws.Range("B5"), Len(ws.Range("B5")) - ws.Range("C5"))
ws.Range("D5") = Right(ws.Range("B5"), Len(ws.Range("B5")) - ws.Range("C5"))
End Sub
OBJECTS
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
PREREQUISITES
Worksheet Name: Have a worksheet named Analyst.
String: Ensure that the string from which you want to remove characters is captured in cell ("B5").
Number of Characters to Remove: Ensure that the number of characters that you want to remove from the selected string is captured in cell ("C5").
Worksheet Name: Have a worksheet named Analyst.
String: Ensure that the string from which you want to remove characters is captured in cell ("B5").
Number of Characters to Remove: Ensure that the number of characters that you want to remove from the selected string is captured in cell ("C5").
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell reference ("D5") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
String: Select the string from which you want to remove characters by changing the cell reference ("B5") to any cell in the worksheet that contains the string and doesn't conflict with the formula.
Output Range: Select the output range by changing the cell reference ("D5") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
String: Select the string from which you want to remove characters by changing the cell reference ("B5") to any cell in the worksheet that contains the string and doesn't conflict with the formula.
EXPLANATION
To remove characters from the left of the selected string you need to apply a combination of Excel RIGHT and LEN functions.
To remove characters from the left of the selected string you need to apply a combination of Excel RIGHT and LEN functions.
FORMULA
=RIGHT(string,LEN(string)-num_char)
=RIGHT(string,LEN(string)-num_char)
ARGUMENTS
string: The string from which you want to remove the selected number of characters.
num_char: The number of characters that you want to remove from the selected string.