Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Vba help needed.

This is probably simple but my brain is on strike today.

I have some data in column a in the format
yyyxxx
xxxyyy:123456abc
aaabbb:112345yku
aaccdd


What I would like to do is for each cell that has a : in it copy the
data to the right of the : to column b and delete the : in column a.

It should be simple...

I have just done a stocktake using a bar code reader and some of the
barcodes have the serial number separated from the item code by the :.
Where parts do not have a serial number there is no :.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Vba help needed.

hi,

when the copy is made to column b, do you want to delete the : only, or delete
the : and what is on right off :

isabelle

Le 2014-07-06 22:05, XR8 Sprintless a écrit :
This is probably simple but my brain is on strike today.

I have some data in column a in the format
yyyxxx
xxxyyy:123456abc
aaabbb:112345yku
aaccdd


What I would like to do is for each cell that has a : in it copy the data to the
right of the : to column b and delete the : in column a.

It should be simple...

I have just done a stocktake using a bar code reader and some of the barcodes
have the serial number separated from the item code by the :. Where parts do not
have a serial number there is no :.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Vba help needed.


With Selection
.TextToColumns Destination:=Range(.Cells(1).Address), OtherChar:=":",
FieldInfo:=Array(Array(1, 1))
End With

isabelle

Le 2014-07-06 22:15, isabelle a écrit :
hi,

when the copy is made to column b, do you want to delete the : only, or delete
the : and what is on right off :

isabelle

Le 2014-07-06 22:05, XR8 Sprintless a écrit :
This is probably simple but my brain is on strike today.

I have some data in column a in the format
yyyxxx
xxxyyy:123456abc
aaabbb:112345yku
aaccdd


What I would like to do is for each cell that has a : in it copy the data to the
right of the : to column b and delete the : in column a.

It should be simple...

I have just done a stocktake using a bar code reader and some of the barcodes
have the serial number separated from the item code by the :. Where parts do not
have a serial number there is no :.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Vba help needed.

otherwise,

For Each c In Selection
If Not IsError(Application.Find(":", c)) Then
Cells(c.Row, 2) = Right(c, Len(c) - Application.Find(":", c))
Cells(c.Row, 1) = Application.Substitute(c, ":", " ")
End If
Next

isabelle

Le 2014-07-06 22:39, isabelle a écrit :

With Selection
.TextToColumns Destination:=Range(.Cells(1).Address), OtherChar:=":",
FieldInfo:=Array(Array(1, 1))
End With

isabelle

Le 2014-07-06 22:15, isabelle a écrit :
hi,

when the copy is made to column b, do you want to delete the : only, or delete
the : and what is on right off :

isabelle

Le 2014-07-06 22:05, XR8 Sprintless a écrit :
This is probably simple but my brain is on strike today.

I have some data in column a in the format
yyyxxx
xxxyyy:123456abc
aaabbb:112345yku
aaccdd


What I would like to do is for each cell that has a : in it copy the data to the
right of the : to column b and delete the : in column a.

It should be simple...

I have just done a stocktake using a bar code reader and some of the barcodes
have the serial number separated from the item code by the :. Where parts do not
have a serial number there is no :.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default Vba help needed.

Text to Columns will do that in a flash.

Gord

On Mon, 07 Jul 2014 12:05:11 +1000, XR8 Sprintless
wrote:

This is probably simple but my brain is on strike today.

I have some data in column a in the format
yyyxxx
xxxyyy:123456abc
aaabbb:112345yku
aaccdd


What I would like to do is for each cell that has a : in it copy the
data to the right of the : to column b and delete the : in column a.

It should be simple...

I have just done a stocktake using a bar code reader and some of the
barcodes have the serial number separated from the item code by the :.
Where parts do not have a serial number there is no :.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Vba help needed.

On 8/07/2014 5:29 AM, Gord Dibben wrote:
Text to Columns will do that in a flash.


Thanks Gord

That's how I ended up doing it. I knew it would be simple but was brain
fried that day...

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Rows With Non-Needed Data between Needed Data Daren Excel Worksheet Functions 2 September 30th 08 06:47 PM
vb needed i think... Les Excel Programming 3 February 8th 07 08:17 PM
MVP HELP NEEDED ! Jane Excel Worksheet Functions 5 February 6th 07 10:48 AM
HELP NEEDED... Paddy[_3_] Excel Programming 3 September 2nd 06 04:32 PM
Help needed! DBsWifeLB Excel Worksheet Functions 3 March 14th 06 08:23 PM


All times are GMT +1. The time now is 11:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"