Eliminar numeros en celdas con valores alfanumericos.mp4


Uploaded by erli2008 on 16.05.2011

Transcript:
Hi, this is eng. Elio Reyes
I'm back again with my videotutos for showing you the powerful advantages
of Excel programming.
The advantages it has for the final user.
In this opportunity, a Twitter user had asked a question:
He wanted to delete numbers in an alphanumeric Excel cells,
remaining only letters as a cell value.
So, I programmed a button...
Let's see how it works...
...it automatically do the job for me.
Now, Let's see how this code has been made.
This code is relatively short.
I programmed the button's CLICK event.
The variables I have declared are...
"seguir" for execution of the conditional loop DO-WHILE-LOOP
It's a boolean variable, it means TRUE or FALSE
"TextoAlfanumerico" is declared as a STRING type and
it saves values of each cell in column "A" of the Excel sheet.
"caracter" represents a character in any string in column "A".
"CodigoASCIIcaracter" is a byte type variable which saves ASCII code of the characters...
of the strings in cells in of the column "A", or equivalently,
each character contained in variable "TextoAlfanumerico".
"CadAux" is a string type variable for saving the final result,
it is, the strings in column "A" without numeric characters.
"fila" is an Integer type variable for tracking...
rows in column "A".
"i" is an Integer type variable which works as control variable in the FOR-NEXT loop.
This loop allows us to move through each character of the strings...
in each cell in column "A".
Well, let's see in-depth explanation of the programming core.
First, "seguir" es initialized in TRUE.
"Fila" is initialized in 2 because our first value is in row 2 in column "A".
Then we go inside the body of the DO-WHILE-LOOP. ...
Then we use "TextoAlfanumerico" for saving each cell value in column "A",
using this structure, by means of the Worksheet object and calling "Hoja1" because
it's the worksheet where data is.
I use RANGE property in order it to give us the value of RANGE object.
Then I call column "A" and with this little string algebra I can
go through every range "A2", "A3", "A4" till I reach the last value.