PDA

Click to See Complete Forum and Search --> : Reading from a cell in Excel


maryam
May 17th, 2004, 05:37 PM
Hellooooo every one
I am trying to write a macro that reads an array of characters from a Cell within an excel worksheet, which have the form
"EM12"

I want to make the program to seprate the alphabetic part ( Which allways come fist) from the numeric part. It could easily be done in C++ by comparing the values of array[i], but I am not as familir with VBA and I get error

Thanks so much please tell me how to do it!:afrog:

Garratt
May 17th, 2004, 08:59 PM
Is everything always 2 alpha and 2 number?

TempstringA = Left(Cells(1,1).value,2)
TempStringB = Right(Cells(1,1).value,2)
TempIntegerA = Val(TempStringB)

maryam
May 18th, 2004, 12:03 AM
No that is not the case I want to be able to read and process each character by itself. because the format is not allways the Same.