I'm not sure what you macro looks like, and whether you are looping through the 
records.
If you ARE looping through each row, you can split the cell value into an 
array, then write the array elements to the separate cells.
for instance, if cell AE2 has "JOUR 103 D A"then,nRow = 2sArray = 
split(cells(nRow,"AE").value," ")cells(nRow,"BP").value = sArray(0) & " " & 
sArray(1)if (ubound(sArray) > 1) then    str = sarray(2)    if (ubound(sArray) 
> 2) then      for inx = 3 to ubound(sArray)         str = str & " " & 
sArray(inx)      next inx     end if    cells(nRow, "BQ").value = strend if
Paul-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------
 
      From: Jordan Nofziger <jpnofzi...@gmail.com>
 To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> 
 Sent: Tuesday, August 4, 2015 11:41 AM
 Subject: $$Excel-Macros$$ Copy data from one column and create a new one
   
I've been working with a macro that I have inherited and I'm trying to make 
some updates to help with some changes that have been made in the department.

I have data in column AE, which is titled 'crs_cde' (see below).

crs_cde
JOUR 103 D A
JOUR 101 D A
JOUR 101 O A ON
JOUR 215 D B
JOUR 317 D A
JOUR 341 D A
JOUR 541 D A
JOUR 215 D A
JOUR 280 D A
JOUR 280 D B
(note that this is just a sampling. I pull this data from an internal system at 
various times, so the length of the column fluctuates)

I would like to split this data into two new cells, while retaining the 
original data in the original cells.

Basically, I want to take the 'JOUR' data and put it in a new column titled 
'Course Cde' (column BP) and the 'D A', 'O A ON', etc data into a new column 
titled 'Course Sec' (Column BQ).

I'm new to macros, so I'm having a difficult time writing a code that will help 
me achieve this goal. I know that this can be done with a simple formula that I 
then fill down, but I'd really like to have a code to add to my current macro 
to streamline the process a bit. Any help would be greatly appreciated.

Thank you!
-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel
 
FORUM RULES
 
1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.
 
NOTE : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.


   

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to