extract first letter from cell

RAYLWARD102

Well-known Member
Joined
May 27, 2010
Messages
529
What's the easiest way for me to extract the first letter from a cell value or a string.
I'm creating macro code that will be inserting a new line of information but it needs to be entered alphabetically so I'm going to attempt to search by using the first letter of the cell and the first letter of the newly inserted data.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Can you show some sample data you want to use.

I am assuming you would use the Left function, but it is possible you have numbers in the cell as well before the letters, so it would be useful to see some sample data. You can copy the data normally and also use paste or one of the converts recommended on the Forum.
 
Upvote 0
The data will always be a letter.
Even if for some reason a number is entered as the first character, It doesn't matter. I'm going to get the FIRST CHARACTER from the new data and find the same letter in the column of data and insert the line accordingly at that point.
I'm only going by the first character for alphabetizing

so the column data would be a1= a, a2 = b, a3= c... and so on. I'll be getting the first letter of the newly entered string and then loop through the column data to find the same letter. That part of the macro is already done except for the finding the first character in a string or cell value.
 
Last edited:
Upvote 0
The data will always be a letter.
Even if for some reason a number is entered as the first character, It doesn't matter. I'm going to get the FIRST CHARACTER from the new data and find the same letter in the column of data and insert the line accordingly at that point.
I'm only going by the first character for alphabetizing
VB has a Left function that you can use to retrieve the left however many characters you want. Let's say you wanted the left character from cell A1...

LeftLetterInA1 = Left(Range("A1").Value, 1)
 
Upvote 0
As I read your thread and you say it is text then left is the function, but you aren't clear and not willing to show some sample as requested so how can anyone help you !

Excel Workbook
AB
1DataLeft Function
2MiddleM
3LaterL
4LastL
5TomorrowT
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top