PC Review


Reply
Thread Tools Rate Thread

From Column A get Text from Colum B

 
 
DaveM
Guest
Posts: n/a
 
      10th Nov 2007
Hi

I have text cells in column B, The text cells in column B start with some
word or words followed by a space-space then the rest of text.

Example:

Cell B1

Analogue (Analog) circuit - An electronic circuit in which an electrical
value (usually voltage or current, but sometimes frequency, phase)
represents something in the physical world.The magnitude of the electrical
value varies with with the intensity of an external physical quantity.

How could I get "Analogue (Analog) circuit" and put it in column A1.

There is lot of cells in the columns and I'd like to go down one at a time,
and move these to column A.

Thanks in advance

Dave




 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      10th Nov 2007
=search(" - ",b1)
will return the position of that " - " string.

So
=left(b1,search(" - ",b1)-1)
will return the beginning of that string in B1

If there's a chance that there's no " - " in that string, you can avoid the
error and bring back everything with a formula like:
=left(b1,search(" - ",b1&" - ")-1)


DaveM wrote:
>
> Hi
>
> I have text cells in column B, The text cells in column B start with some
> word or words followed by a space-space then the rest of text.
>
> Example:
>
> Cell B1
>
> Analogue (Analog) circuit - An electronic circuit in which an electrical
> value (usually voltage or current, but sometimes frequency, phase)
> represents something in the physical world.The magnitude of the electrical
> value varies with with the intensity of an external physical quantity.
>
> How could I get "Analogue (Analog) circuit" and put it in column A1.
>
> There is lot of cells in the columns and I'd like to go down one at a time,
> and move these to column A.
>
> Thanks in advance
>
> Dave


--

Dave Peterson
 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      10th Nov 2007
With a formula
=LEFT(I22,FIND("-",I22)-2)

a macro

mr=range("i22")
mr.value=LEFT(mr,FIND("-",mr)-2)
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"DaveM" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I have text cells in column B, The text cells in column B start with some
> word or words followed by a space-space then the rest of text.
>
> Example:
>
> Cell B1
>
> Analogue (Analog) circuit - An electronic circuit in which an electrical
> value (usually voltage or current, but sometimes frequency, phase)
> represents something in the physical world.The magnitude of the electrical
> value varies with with the intensity of an external physical quantity.
>
> How could I get "Analogue (Analog) circuit" and put it in column A1.
>
> There is lot of cells in the columns and I'd like to go down one at a
> time, and move these to column A.
>
> Thanks in advance
>
> Dave
>
>
>
>


 
Reply With Quote
 
DaveM
Guest
Posts: n/a
 
      10th Nov 2007
Hi Dave

Works a treat

Thanks for your fast reply

All the best

DaveM


"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> =search(" - ",b1)
> will return the position of that " - " string.
>
> So
> =left(b1,search(" - ",b1)-1)
> will return the beginning of that string in B1
>
> If there's a chance that there's no " - " in that string, you can avoid
> the
> error and bring back everything with a formula like:
> =left(b1,search(" - ",b1&" - ")-1)
>
>
> DaveM wrote:
>>
>> Hi
>>
>> I have text cells in column B, The text cells in column B start with some
>> word or words followed by a space-space then the rest of text.
>>
>> Example:
>>
>> Cell B1
>>
>> Analogue (Analog) circuit - An electronic circuit in which an electrical
>> value (usually voltage or current, but sometimes frequency, phase)
>> represents something in the physical world.The magnitude of the
>> electrical
>> value varies with with the intensity of an external physical quantity.
>>
>> How could I get "Analogue (Analog) circuit" and put it in column A1.
>>
>> There is lot of cells in the columns and I'd like to go down one at a
>> time,
>> and move these to column A.
>>
>> Thanks in advance
>>
>> Dave

>
> --
>
> Dave Peterson



 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      10th Nov 2007
> a macro
>
> mr=range("i22")
> mr.value=LEFT(mr,FIND("-",mr)-2)


I believe it should be more like this...

Set mr = Range("B1")
mr.Offset(0, -1).Value = Left(mr.Value, InStr(mr.Value, "-") - 2)

Rick
 
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
Compare text string of a cell in Column A VS another cell in Colum =?Utf-8?B?VGFu?= Microsoft Excel New Users 2 1st Aug 2007 09:45 AM
Compare text string of a cell in Column A VS another cell in Colum =?Utf-8?B?VGFu?= Microsoft Excel Misc 1 1st Aug 2007 09:03 AM
Counting a mixed text/number column based on text in another colum =?Utf-8?B?U2llcnJhIFZpc3RhIFN0ZXZl?= Microsoft Excel Misc 3 17th Dec 2006 05:30 PM
find text in column h and total the corresponding numbers if colum =?Utf-8?B?YWRlbGFpZGU=?= Microsoft Excel Misc 2 6th Feb 2006 04:47 AM
Putting text in a column based on variable text from another colum =?Utf-8?B?SmFja3kgRC4=?= Microsoft Excel Misc 1 16th Dec 2004 06:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:39 AM.