![]() |
cut and paste 5 numbers from one col to another for entire column
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 |
cut and paste 5 numbers from one col to another for entire column
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 |
cut and paste 5 numbers from one col to another for entire col
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 |
cut and paste 5 numbers from one col to another for entire col
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 |
cut and paste 5 numbers from one col to another for entire col
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 |
cut and paste 5 numbers from one col to another for entire col
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 |
All times are GMT +1. The time now is 02:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com