PC Review


Reply
Thread Tools Rate Thread

Changing Contents of a cell.

 
 
Adam
Guest
Posts: n/a
 
      21st Feb 2008
Ok, So i have a few columns of data with about 1600 rows or so per column

The data in the rows looks like what is shown below. The numbers in the
rows are stored as text. Here is what i need to do, I need the first number
ONLY, and not the percentage. So basically i need to turn every cell into
the number that appears first in every cell, and then delete the parentheses
and percentages.

Anyone have any easy way to do this?

3 (8%)
4 (12%)
0 (0%)
8 (15%)
0 (0%)
0 (0%)
0 (0%)
0 (0%)
0 (0%)
7 (5%)
6 (3%)
10 (4%)

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      21st Feb 2008
Without VBA, use Text to Columns with the space as a separator.

With VBA, select the cells and run:

Sub numberr()
For Each r In Selection
r.Value = Split(r.Value, " ")(0)
Next
End Sub
--
Gary''s Student - gsnu200770


"Adam" wrote:

> Ok, So i have a few columns of data with about 1600 rows or so per column
>
> The data in the rows looks like what is shown below. The numbers in the
> rows are stored as text. Here is what i need to do, I need the first number
> ONLY, and not the percentage. So basically i need to turn every cell into
> the number that appears first in every cell, and then delete the parentheses
> and percentages.
>
> Anyone have any easy way to do this?
>
> 3 (8%)
> 4 (12%)
> 0 (0%)
> 8 (15%)
> 0 (0%)
> 0 (0%)
> 0 (0%)
> 0 (0%)
> 0 (0%)
> 7 (5%)
> 6 (3%)
> 10 (4%)
>

 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      21st Feb 2008
Hey Thanks for the help,

Can you walk me through doing the without VBA method. THanks,

-ADam
"Gary''s Student" wrote:

> Without VBA, use Text to Columns with the space as a separator.
>
> With VBA, select the cells and run:
>
> Sub numberr()
> For Each r In Selection
> r.Value = Split(r.Value, " ")(0)
> Next
> End Sub
> --
> Gary''s Student - gsnu200770
>
>
> "Adam" wrote:
>
> > Ok, So i have a few columns of data with about 1600 rows or so per column
> >
> > The data in the rows looks like what is shown below. The numbers in the
> > rows are stored as text. Here is what i need to do, I need the first number
> > ONLY, and not the percentage. So basically i need to turn every cell into
> > the number that appears first in every cell, and then delete the parentheses
> > and percentages.
> >
> > Anyone have any easy way to do this?
> >
> > 3 (8%)
> > 4 (12%)
> > 0 (0%)
> > 8 (15%)
> > 0 (0%)
> > 0 (0%)
> > 0 (0%)
> > 0 (0%)
> > 0 (0%)
> > 7 (5%)
> > 6 (3%)
> > 10 (4%)
> >

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      21st Feb 2008
Select the column and pull-down:

Data > Text to Columns... > Delimited > Next > check space clear tab > Next >
click first column > General > click next column > do not import > Finish
--
Gary''s Student - gsnu200770


"Adam" wrote:

> Hey Thanks for the help,
>
> Can you walk me through doing the without VBA method. THanks,
>
> -ADam
> "Gary''s Student" wrote:
>
> > Without VBA, use Text to Columns with the space as a separator.
> >
> > With VBA, select the cells and run:
> >
> > Sub numberr()
> > For Each r In Selection
> > r.Value = Split(r.Value, " ")(0)
> > Next
> > End Sub
> > --
> > Gary''s Student - gsnu200770
> >
> >
> > "Adam" wrote:
> >
> > > Ok, So i have a few columns of data with about 1600 rows or so per column
> > >
> > > The data in the rows looks like what is shown below. The numbers in the
> > > rows are stored as text. Here is what i need to do, I need the first number
> > > ONLY, and not the percentage. So basically i need to turn every cell into
> > > the number that appears first in every cell, and then delete the parentheses
> > > and percentages.
> > >
> > > Anyone have any easy way to do this?
> > >
> > > 3 (8%)
> > > 4 (12%)
> > > 0 (0%)
> > > 8 (15%)
> > > 0 (0%)
> > > 0 (0%)
> > > 0 (0%)
> > > 0 (0%)
> > > 0 (0%)
> > > 7 (5%)
> > > 6 (3%)
> > > 10 (4%)
> > >

 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      21st Feb 2008
NM, Figured it out,

Thanks again

"Adam" wrote:

> Hey Thanks for the help,
>
> Can you walk me through doing the without VBA method. THanks,
>
> -ADam
> "Gary''s Student" wrote:
>
> > Without VBA, use Text to Columns with the space as a separator.
> >
> > With VBA, select the cells and run:
> >
> > Sub numberr()
> > For Each r In Selection
> > r.Value = Split(r.Value, " ")(0)
> > Next
> > End Sub
> > --
> > Gary''s Student - gsnu200770
> >
> >
> > "Adam" wrote:
> >
> > > Ok, So i have a few columns of data with about 1600 rows or so per column
> > >
> > > The data in the rows looks like what is shown below. The numbers in the
> > > rows are stored as text. Here is what i need to do, I need the first number
> > > ONLY, and not the percentage. So basically i need to turn every cell into
> > > the number that appears first in every cell, and then delete the parentheses
> > > and percentages.
> > >
> > > Anyone have any easy way to do this?
> > >
> > > 3 (8%)
> > > 4 (12%)
> > > 0 (0%)
> > > 8 (15%)
> > > 0 (0%)
> > > 0 (0%)
> > > 0 (0%)
> > > 0 (0%)
> > > 0 (0%)
> > > 7 (5%)
> > > 6 (3%)
> > > 10 (4%)
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing contents of cell based on Cell Format HeatherJ Microsoft Excel Worksheet Functions 3 22nd Dec 2009 03:06 PM
Changing Cell Contents Orion Cochrane Microsoft Excel Programming 3 16th Dec 2008 04:16 PM
Changing cell contents Mike Microsoft Excel Misc 2 11th Feb 2008 04:41 PM
Changing the Contents of a Cell =?Utf-8?B?UGF1bFc=?= Microsoft Excel Misc 0 30th Mar 2006 10:40 AM
Moving contents of a cell without changing references to that cell elbows Microsoft Excel Misc 2 29th Mar 2004 05:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:20 PM.