Convert text to numbers

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
890
<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> Hi all, I download the below data from payroll system as shown in F.1. Kindly requesting to create a VB code so that to be able to sum the columns from “C” : “G”. Note that the rows are change each time when I download the report due to termination and new employments. As I realized the numbers appears as text and I would like to convert them to numbers so that to be able to sum them in col. "H". In F.2. I present the expected result. I would be greatly appreciated any support. Thanking you in advance



F.1.



[TABLE="class: MsoTableGrid"]
<tbody>[TR]
[TD="width: 36"]
[/TD]
[TD="width: 156"] B
[/TD]
[TD="width: 83"] C
[/TD]
[TD="width: 67"]
D
[/TD]
[TD="width: 64"]
E
[/TD]
[TD="width: 70"]
F
[/TD]
[TD="width: 64"]
G
[/TD]
[TD="width: 63"]
H
[/TD]
[/TR]
[TR]
[TD="width: 36"] 3
[/TD]
[TD="width: 156"] Employee Name
[/TD]
[TD="width: 83"] Balance B/F
[/TD]
[TD="width: 67"]
An.Leav
[/TD]
[TD="width: 64"]
P.H.
[/TD]
[TD="width: 70"]
Sundays
[/TD]
[TD="width: 64"]
Off
[/TD]
[TD="width: 63"]
Total
[/TD]
[/TR]
[TR]
[TD="width: 36"] 4
[/TD]
[TD="width: 156"] Xxxxxxxxxx xxxxxxxx
[/TD]
[TD="width: 83"]
[/TD]
[TD="width: 67"]
02.04
[/TD]
[TD="width: 64"]
00.00
[/TD]
[TD="width: 70"]
00.00
[/TD]
[TD="width: 64"]
08.62
[/TD]
[TD="width: 63"]
0.00
[/TD]
[/TR]
</tbody>[/TABLE]



F.2.

[TABLE="class: MsoNormalTable, width: 500"]
<tbody>[TR]
[TD="width: 65"] [TABLE="class: MsoTableGrid, width: 452"]
<tbody>[TR]
[TD="width: 36"]
[/TD]
[TD="width: 156"] B
[/TD]
[TD="width: 83"] C
[/TD]
[TD="width: 67"]
D
[/TD]
[TD="width: 64"]
E
[/TD]
[TD="width: 70"]
F
[/TD]
[TD="width: 64"]
G
[/TD]
[TD="width: 63"]
H
[/TD]
[/TR]
[TR]
[TD="width: 36"] 3
[/TD]
[TD="width: 156"] Employee Name
[/TD]
[TD="width: 83"] Balance B/F
[/TD]
[TD="width: 67"]
An.Leav
[/TD]
[TD="width: 64"]
P.H.
[/TD]
[TD="width: 70"]
Sundays
[/TD]
[TD="width: 64"]
Off
[/TD]
[TD="width: 63"]
Total
[/TD]
[/TR]
[TR]
[TD="width: 36"] 4
[/TD]
[TD="width: 156"] Xxxxxxxxxx xxxxxxxx
[/TD]
[TD="width: 83"]
[/TD]
[TD="width: 67"]
2.04
[/TD]
[TD="width: 64"]
0.00
[/TD]
[TD="width: 70"]
0.00
[/TD]
[TD="width: 64"]
8.62
[/TD]
[TD="width: 63"]
10.66
[/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD="width: 202"]
[/TD]
[TD="width: 80"]
[/TD]
[TD="width: 64"]
[/TD]
[TD="width: 64"]
[/TD]
[TD="width: 64"]
[/TD]
[TD="width: 64"]
[/TD]
[TD="width: 64"]
[/TD]
[/TR]
</tbody>[/TABLE]
<!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} table.MsoTableGrid {mso-style-name:"Table Grid"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; border:solid windowtext 1.0pt; mso-border-alt:solid windowtext .5pt; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-border-insideh:.5pt solid windowtext; mso-border-insidev:.5pt solid windowtext; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]-->
 
maybe you can download and install > Download

then use that to post the cells that you are working with on the forum
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi again mole, i download it as Unicode text and it works perfectly. Is a destitution for me but actually it formats the data as i wanted to be numbers and texts. I tested several times and it appears the correct data. However thanks once again for your support!
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

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