Hi All,
I have company name in Column A. I need the first 12 of this company name in column B. I used to get this done using LEFT formula. Is this possible to combine in vba, so a when I execute the code, I should get the same result.
Hi All,
I have company name in Column A. I need the first 12 of this company name in column B. I used to get this done using LEFT formula. Is this possible to combine in vba, so a when I execute the code, I should get the same result.
Hi
assuming your company names are in column 1 starting in cell 2, and you want the output in column B, try this.
The macro will stop when it reaches a blank cell in column A
![]()
Sub lefts() x = 2 ' row with first value Do While Cells(x, 1) <> "" Cells(x, 2) = Left(Cells(x, 1), 12) x = x + 1 Loop End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks