Hi!
I have data in multiple rows and columns that looks as below, i.e., group of nos. and ratios separated by commas:
[TABLE="width: 578"]
[TD="align: center"]USA
[/TD]
[TD="align: center"]CANADA
[/TD]
[TD="align: center"]RUSSIA
[/TD]
39008,29396,1.327 - 1,
10056,17020,1 - 1.693,95
28829,43751,1 - 1.518,89
4380,6085,1 - 1.389,
25805,24920,1.036 - 1,
5259,9780,1 - 1.860,
5771,7304,1 - 1.266,
30066,30074,1 - 1.000,20
13026,17561,1 - 1.348,
6271,6129,1.023 - 1,
29012,33676,1 - 1.161,27
10829,16963,1 - 1.566,
6268,6129,1.023 - 1,84
29071,34456,1 - 1.185,40
16569,22161,1 - 1.337,
6268,6229,1.006 - 1,83
28213,34609,1 - 1.227,45
13003,19053,1 - 1.465,
6463,6223,1.039 - 1,55
28800,33519,1 - 1.164,44
12693,20713,1 - 1.632,
6464,6836,1 - 1.058,
28961,34922,1 - 1.206,46
15448,22052,1 - 1.427,62
7064,7646,1 - 1.082,
30333,37335,1 - 1.231,53
20819,28523,1 - 1.370,63
6995,8277,1 - 1.183,
15386,37116,1 - 2.412,88
20894,30302,1 - 1.450,67
6995,8457,1 - 1.209,
15674,35386,1 - 2.258,89
21594,29997,1 - 1.389,63
7201,8460,1 - 1.175,
15542,38347,1 - 2.467,95
21161,30614,1 - 1.447,69
[/TABLE]
What I need is a macro (or a formula) that deletes everything after the occurrence of the second comma in each cell, including the second comma also.
So my new data should look like this:
[TABLE="width: 578"]
USA
CANADA
RUSSIA
39008,29396
10056,17020
28829,43751
4380,6085
25805,24920
5259,9780
5771,7304
30066,30074
13026,17561
6271,6129
29012,33676
10829,16963
6268,6129
29071,34456
16569,22161
6268,6229
28213,34609
13003,19053
6463,6223
28800,33519
12693,20713
6464,6836
28961,34922
15448,22052
7064,7646
30333,37335
20819,28523
6995,8277
15386,37116
20894,30302
6995,8457
15674,35386
21594,29997
7201,8460
15542,38347
21161,30614
[/TABLE]
Please note that the macro will need to be run on a range of about 275 columns and 1500 rows.
If the solution is a formula, I can always use it on another sheet by looking at the data range on the first sheet.
Thanx,
Naira