PDA

View Full Version : Solved: Macro to convert num to char



abraham30
05-11-2012, 11:24 AM
Dear friends,
I have to count the number of record based on the field provided in excel.
But problem is that data are present in numeric format. I have to convert into character and then count the character data.

Can anyone change the macro in excel by converting num to char
Advance thanks

Teeroy
05-12-2012, 01:04 AM
I would use a pivottable instead of coding this problem. The pivotable count summary won't care if there's numbers or characters in the cell. You can use the pivottable to count the number of records matching any filter criteria you want.

abraham30
05-12-2012, 08:21 AM
Dear Terroy,
Thanks for your response
I know it is possible through pivot. but can we get the output using macro code

Teeroy
05-12-2012, 10:15 PM
I've added a second sheet to your Workbook to use as a coded lookup table and modified your code to use it. It builds the strings that I think you were after and is easier to read. You should be able to modify it to your exact purpose.

There were some values in the data that you hadn't identified in your key so I created values called unknown for these in the lookup table otherwise the .FIND method throws an error.

abraham30
05-13-2012, 12:58 AM
Thanks Teeroy from the bottom of my heart. You save my time.
God bless you.....:bow: : pray2: