PC Review


Reply
Thread Tools Rate Thread

Deleting characters in a column of cells -converting to text strin

 
 
Chris Maddogz
Guest
Posts: n/a
 
      15th Jun 2009
I have a column of data (unknown in depth) in A

The data starts in A2.

Each cell contains 6 characters with the last 3 characters as .AX (eg AGK.AX).

I would like to remove the ".AX" from every cell in the column and move it
to its adjacent position in column B until it finds no data in a cell in
column A.

I would then like to copy that entire resultant column B data into cell C2
but as a text string with imbedded spaces between each piece of data.

e.g.
Cell A2 has AGK.AX becomes AGK in B2
Cell A3 has AMC.AX becomes AMC in B3
Cell A4 has AMP.AX becomes AMP in B4
etc until no data incolumn A

After processing the entire column A into column B Cell C2 becomes AGK AMC
AMP etc

Thanks

 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      15th Jun 2009
Hi Chris

Try the below which works on active sheet ..

Sub Mac()
Dim lngRow As Long, lngLastRow As Long
Dim strData As String
lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For lngRow = 2 To lngLastRow
If Range("A" & lngRow) <> "" Then
Range("B" & lngRow) = Split(Range("A" & lngRow), ".")(0)
strData = strData & " " & Split(Range("A" & lngRow), ".")(0)
End If
Next
Range("C2") = Trim(strData)
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Chris Maddogz" wrote:

> I have a column of data (unknown in depth) in A
>
> The data starts in A2.
>
> Each cell contains 6 characters with the last 3 characters as .AX (eg AGK.AX).
>
> I would like to remove the ".AX" from every cell in the column and move it
> to its adjacent position in column B until it finds no data in a cell in
> column A.
>
> I would then like to copy that entire resultant column B data into cell C2
> but as a text string with imbedded spaces between each piece of data.
>
> e.g.
> Cell A2 has AGK.AX becomes AGK in B2
> Cell A3 has AMC.AX becomes AMC in B3
> Cell A4 has AMP.AX becomes AMP in B4
> etc until no data incolumn A
>
> After processing the entire column A into column B Cell C2 becomes AGK AMC
> AMP etc
>
> Thanks
>

 
Reply With Quote
 
Chris Maddogz
Guest
Posts: n/a
 
      15th Jun 2009
Thanks again Jacob works a treat

"Jacob Skaria" wrote:

> Hi Chris
>
> Try the below which works on active sheet ..
>
> Sub Mac()
> Dim lngRow As Long, lngLastRow As Long
> Dim strData As String
> lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
> For lngRow = 2 To lngLastRow
> If Range("A" & lngRow) <> "" Then
> Range("B" & lngRow) = Split(Range("A" & lngRow), ".")(0)
> strData = strData & " " & Split(Range("A" & lngRow), ".")(0)
> End If
> Next
> Range("C2") = Trim(strData)
> End Sub
>
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "Chris Maddogz" wrote:
>
> > I have a column of data (unknown in depth) in A
> >
> > The data starts in A2.
> >
> > Each cell contains 6 characters with the last 3 characters as .AX (eg AGK.AX).
> >
> > I would like to remove the ".AX" from every cell in the column and move it
> > to its adjacent position in column B until it finds no data in a cell in
> > column A.
> >
> > I would then like to copy that entire resultant column B data into cell C2
> > but as a text string with imbedded spaces between each piece of data.
> >
> > e.g.
> > Cell A2 has AGK.AX becomes AGK in B2
> > Cell A3 has AMC.AX becomes AMC in B3
> > Cell A4 has AMP.AX becomes AMP in B4
> > etc until no data incolumn A
> >
> > After processing the entire column A into column B Cell C2 becomes AGK AMC
> > AMP etc
> >
> > Thanks
> >

 
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
deleting characters from autofiltered cells. bert Microsoft Excel Programming 4 12th Oct 2008 05:50 PM
Deleting LF Characters in cells BillH Microsoft Excel Worksheet Functions 9 19th Mar 2008 10:19 PM
Deleting characters to the right in a column.... J.W. Aldridge Microsoft Excel Programming 7 1st Oct 2007 05:14 PM
Re: Converting text to Hyperlink cells in a column Don Guillett Microsoft Excel Worksheet Functions 1 26th Dec 2006 09:21 PM
Converting a column of cells to change the text to be capitalized. =?Utf-8?B?Q2xheXRvbg==?= Microsoft Excel Misc 3 24th Jan 2004 01:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:04 PM.