DONUT PROJECT - VBA - Excel - Removendo os Caracteres Alfabéticos e Especiais
Sabe aqueles projetos onde precisamos limpar os dados contidos em diversas planilhas?
O código abaixo
'Remove All Alpha and Special characters from cellFunctionRemove_AlphaSpecialChar (DataCellAsRange)AsString' Declaração de Variável.DimiCntAsIntegerDimIpDataAsRangeDimsDataAsString, sTmpAsStringIfDataCell.Count <> 1ThenMsgBox ("Por favor, selecione uma célula"), vbInformationExitFunctionEndIf' Loop que checa todos os caracteres disponíveis na célula.ForiCnt = 1ToLen(DataCell.Text)IfMid(DataCell.Text, iCnt, 1)Like"[0-9]"ThenLet sData = sData & Mid(DataCell.Text, iCnt, 1)EndIfNextiCntLetRemove_AlphaSpecialChar = sDataEndFunction

