Hi
I have the following code to extract two characters from the left to range A1 to A100 from text in B1 to B100. Please advise where I am wrong in this code
Thanks
Sub extractingleft()
Dim searchrange As Range, c As Range
Set searchrange = ThisWorkbook.Worksheets(1).Range("B2:B100")
For Each c In searchrange
d = WorksheetFunction.left(searchrange, 2)
c = searchrange.Offset(0, -1)
c.Value = d
Next c
End S
I have the following code to extract two characters from the left to range A1 to A100 from text in B1 to B100. Please advise where I am wrong in this code
Thanks
Sub extractingleft()
Dim searchrange As Range, c As Range
Set searchrange = ThisWorkbook.Worksheets(1).Range("B2:B100")
For Each c In searchrange
d = WorksheetFunction.left(searchrange, 2)
c = searchrange.Offset(0, -1)
c.Value = d
Next c
End S