PC Review


Reply
Thread Tools Rate Thread

cut and paste 5 numbers from one col to another for entire column

 
 
=?Utf-8?B?Q2hlZXNlX3doaXo=?=
Guest
Posts: n/a
 
      17th Nov 2006
I'm trying to figure out how, in Excel, I'd cut the first five digits off the
numbers that appear in each cell of one column and then append those numbers
to the corresponding cells in another column.

Would that be a query of some sort, or done with vba? I'm more experienced
with Access than Excel.

Thanks in advance,
CW
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      17th Nov 2006
Very simple in VBA:

Sub appnd()
For i = 1 To 5
Cells(i, "B").Value = Cells(i, "B").Value & Left(Cells(i, "A").Value, 5)
Next
End Sub

--
Gary's Student


"Cheese_whiz" wrote:

> I'm trying to figure out how, in Excel, I'd cut the first five digits off the
> numbers that appear in each cell of one column and then append those numbers
> to the corresponding cells in another column.
>
> Would that be a query of some sort, or done with vba? I'm more experienced
> with Access than Excel.
>
> Thanks in advance,
> CW

 
Reply With Quote
 
=?Utf-8?B?Q2hlZXNlX3doaXo=?=
Guest
Posts: n/a
 
      17th Nov 2006
Thanks GS,

I just put that code in the vba editor and ran it. It worked except it only
worked on five cells and then stopped. I need it to work on all cells in the
column

Also, any easy way to delete those first 5 numbers from the original column
they were in (A)?

Thanks a ton!
CW

"Gary''s Student" wrote:

> Very simple in VBA:
>
> Sub appnd()
> For i = 1 To 5
> Cells(i, "B").Value = Cells(i, "B").Value & Left(Cells(i, "A").Value, 5)
> Next
> End Sub
>
> --
> Gary's Student
>
>
> "Cheese_whiz" wrote:
>
> > I'm trying to figure out how, in Excel, I'd cut the first five digits off the
> > numbers that appear in each cell of one column and then append those numbers
> > to the corresponding cells in another column.
> >
> > Would that be a query of some sort, or done with vba? I'm more experienced
> > with Access than Excel.
> >
> > Thanks in advance,
> > CW

 
Reply With Quote
 
=?Utf-8?B?Q2hlZXNlX3doaXo=?=
Guest
Posts: n/a
 
      17th Nov 2006
Ok, I'm dumb.

I can change the upper value for I to get any number of columns....

CW

"Cheese_whiz" wrote:

> Thanks GS,
>
> I just put that code in the vba editor and ran it. It worked except it only
> worked on five cells and then stopped. I need it to work on all cells in the
> column
>
> Also, any easy way to delete those first 5 numbers from the original column
> they were in (A)?
>
> Thanks a ton!
> CW
>
> "Gary''s Student" wrote:
>
> > Very simple in VBA:
> >
> > Sub appnd()
> > For i = 1 To 5
> > Cells(i, "B").Value = Cells(i, "B").Value & Left(Cells(i, "A").Value, 5)
> > Next
> > End Sub
> >
> > --
> > Gary's Student
> >
> >
> > "Cheese_whiz" wrote:
> >
> > > I'm trying to figure out how, in Excel, I'd cut the first five digits off the
> > > numbers that appear in each cell of one column and then append those numbers
> > > to the corresponding cells in another column.
> > >
> > > Would that be a query of some sort, or done with vba? I'm more experienced
> > > with Access than Excel.
> > >
> > > Thanks in advance,
> > > CW

 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      17th Nov 2006
You are not dumb at all !

Commend yourself for taking the initiatve and coming up with the
modification on your own.

Have a pleasant weekend
--
Gary's Student


"Cheese_whiz" wrote:

> Ok, I'm dumb.
>
> I can change the upper value for I to get any number of columns....
>
> CW
>
> "Cheese_whiz" wrote:
>
> > Thanks GS,
> >
> > I just put that code in the vba editor and ran it. It worked except it only
> > worked on five cells and then stopped. I need it to work on all cells in the
> > column
> >
> > Also, any easy way to delete those first 5 numbers from the original column
> > they were in (A)?
> >
> > Thanks a ton!
> > CW
> >
> > "Gary''s Student" wrote:
> >
> > > Very simple in VBA:
> > >
> > > Sub appnd()
> > > For i = 1 To 5
> > > Cells(i, "B").Value = Cells(i, "B").Value & Left(Cells(i, "A").Value, 5)
> > > Next
> > > End Sub
> > >
> > > --
> > > Gary's Student
> > >
> > >
> > > "Cheese_whiz" wrote:
> > >
> > > > I'm trying to figure out how, in Excel, I'd cut the first five digits off the
> > > > numbers that appear in each cell of one column and then append those numbers
> > > > to the corresponding cells in another column.
> > > >
> > > > Would that be a query of some sort, or done with vba? I'm more experienced
> > > > with Access than Excel.
> > > >
> > > > Thanks in advance,
> > > > CW

 
Reply With Quote
 
=?Utf-8?B?Q2hlZXNlX3doaXo=?=
Guest
Posts: n/a
 
      17th Nov 2006
Thanks again!

I got it to delete the five off the original column too. All set thanks to
your help!

CW

"Gary''s Student" wrote:

> You are not dumb at all !
>
> Commend yourself for taking the initiatve and coming up with the
> modification on your own.
>
> Have a pleasant weekend
> --
> Gary's Student
>
>
> "Cheese_whiz" wrote:
>
> > Ok, I'm dumb.
> >
> > I can change the upper value for I to get any number of columns....
> >
> > CW
> >
> > "Cheese_whiz" wrote:
> >
> > > Thanks GS,
> > >
> > > I just put that code in the vba editor and ran it. It worked except it only
> > > worked on five cells and then stopped. I need it to work on all cells in the
> > > column
> > >
> > > Also, any easy way to delete those first 5 numbers from the original column
> > > they were in (A)?
> > >
> > > Thanks a ton!
> > > CW
> > >
> > > "Gary''s Student" wrote:
> > >
> > > > Very simple in VBA:
> > > >
> > > > Sub appnd()
> > > > For i = 1 To 5
> > > > Cells(i, "B").Value = Cells(i, "B").Value & Left(Cells(i, "A").Value, 5)
> > > > Next
> > > > End Sub
> > > >
> > > > --
> > > > Gary's Student
> > > >
> > > >
> > > > "Cheese_whiz" wrote:
> > > >
> > > > > I'm trying to figure out how, in Excel, I'd cut the first five digits off the
> > > > > numbers that appear in each cell of one column and then append those numbers
> > > > > to the corresponding cells in another column.
> > > > >
> > > > > Would that be a query of some sort, or done with vba? I'm more experienced
> > > > > with Access than Excel.
> > > > >
> > > > > Thanks in advance,
> > > > > CW

 
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
How do I ROUNDUP an entire column of numbers? Yellow Elk Microsoft Excel Misc 3 24th Dec 2007 01:09 PM
how to apply one function to an entire column of numbers =?Utf-8?B?Z3VhdGRvYw==?= Microsoft Excel Worksheet Functions 1 9th Nov 2005 04:26 AM
How to add the same value to an entire column of numbers?? =?Utf-8?B?QnJpdGE=?= Microsoft Excel Worksheet Functions 1 29th Dec 2004 03:53 AM
Change sign of entire column of numbers =?Utf-8?B?UGFtZWxh?= Microsoft Excel Worksheet Functions 3 10th Nov 2003 03:34 PM
How can i paste something into an entire column Joe Hennessey Microsoft Access 2 14th Jul 2003 08:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:10 AM.