Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting up a hopefiully simple macro


Hi I was wondering if using a macro would be a good way to do this.
I have a bunch of cells that have 5 or 6 sentences in each cell. Each
sentence is separated by an Astrisk(*) or double Astrisk(**). Is there a
way to have excel take each sentence and put it into its own cell
automatically? instead of copying each sentence and pasting it into its
own cell one by one?

Thanks


--
ekafrawy
------------------------------------------------------------------------
ekafrawy's Profile: http://www.excelforum.com/member.php...o&userid=24387
View this thread: http://www.excelforum.com/showthread...hreadid=379764

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting up a hopefiully simple macro


Use the -Data Text to Columns- functionality. Specify "delimited
and "other" as the delimiter. Put an "*" in the box, then check th
"Treat consecutive delimiters as one"

HT

--
tkstoc

-----------------------------------------------------------------------
tkstock's Profile: http://www.excelforum.com/member.php...fo&userid=1444
View this thread: http://www.excelforum.com/showthread.php?threadid=37976

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default setting up a hopefiully simple macro

You don't need VBA, use DataText To Columns with a separator of *.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ekafrawy" wrote in
message ...

Hi I was wondering if using a macro would be a good way to do this.
I have a bunch of cells that have 5 or 6 sentences in each cell. Each
sentence is separated by an Astrisk(*) or double Astrisk(**). Is there a
way to have excel take each sentence and put it into its own cell
automatically? instead of copying each sentence and pasting it into its
own cell one by one?

Thanks


--
ekafrawy
------------------------------------------------------------------------
ekafrawy's Profile:

http://www.excelforum.com/member.php...o&userid=24387
View this thread: http://www.excelforum.com/showthread...hreadid=379764



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default setting up a hopefiully simple macro


"ekafrawy" wrote in
message ...

Hi I was wondering if using a macro would be a good way to do this.
I have a bunch of cells that have 5 or 6 sentences in each cell. Each
sentence is separated by an Astrisk(*) or double Astrisk(**). Is there a
way to have excel take each sentence and put it into its own cell
automatically? instead of copying each sentence and pasting it into its
own cell one by one?

Thanks


--
ekafrawy
------------------------------------------------------------------------
ekafrawy's Profile:

http://www.excelforum.com/member.php...o&userid=24387
View this thread: http://www.excelforum.com/showthread...hreadid=379764


If the only column is these cells, then it might be easier to copy/paste
into Word, do a Find-and-Replace(* for ^p then ^p^p for ^p to remove extra
blank lines from ** unless wanted) then copy/paste results back to Excel,
especially if this is a one-time use.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default setting up a hopefiully simple macro

If this is a one-off, a way to do this manually would be to do a
Find/Replace to replace a double asterisk with a single asterisk. Then
choose Data/Text to Columns, select Delimited, and enter the asterisk in
the Other box on the second pane.

If you need to do this repeatedly, you could record a macro of the above.




In article ,
ekafrawy
wrote:

Hi I was wondering if using a macro would be a good way to do this.
I have a bunch of cells that have 5 or 6 sentences in each cell. Each
sentence is separated by an Astrisk(*) or double Astrisk(**). Is there a
way to have excel take each sentence and put it into its own cell
automatically? instead of copying each sentence and pasting it into its
own cell one by one?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default setting up a hopefiully simple macro

I think I like tkstock's response better <vbg, but if the OP is gonna do the
edit|Replace, then it's best to change:

~*~*
to
*

The asterisk is a wild card and xl needs to be told to really look for the
asterisk--not any set of characters.



JE McGimpsey wrote:

If this is a one-off, a way to do this manually would be to do a
Find/Replace to replace a double asterisk with a single asterisk. Then
choose Data/Text to Columns, select Delimited, and enter the asterisk in
the Other box on the second pane.

If you need to do this repeatedly, you could record a macro of the above.

In article ,
ekafrawy
wrote:

Hi I was wondering if using a macro would be a good way to do this.
I have a bunch of cells that have 5 or 6 sentences in each cell. Each
sentence is separated by an Astrisk(*) or double Astrisk(**). Is there a
way to have excel take each sentence and put it into its own cell
automatically? instead of copying each sentence and pasting it into its
own cell one by one?


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default setting up a hopefiully simple macro

thanks for the amplification, Dave!

mumblemumblemumble...<g

In article ,
Dave Peterson wrote:

I think I like tkstock's response better <vbg, but if the OP is gonna do the
edit|Replace, then it's best to change:

~*~*
to
*

The asterisk is a wild card and xl needs to be told to really look for the
asterisk--not any set of characters.



JE McGimpsey wrote:

If this is a one-off, a way to do this manually would be to do a
Find/Replace to replace a double asterisk with a single asterisk. Then
choose Data/Text to Columns, select Delimited, and enter the asterisk in
the Other box on the second pane.

If you need to do this repeatedly, you could record a macro of the above.

In article ,
ekafrawy
wrote:

Hi I was wondering if using a macro would be a good way to do this.
I have a bunch of cells that have 5 or 6 sentences in each cell. Each
sentence is separated by an Astrisk(*) or double Astrisk(**). Is there a
way to have excel take each sentence and put it into its own cell
automatically? instead of copying each sentence and pasting it into its
own cell one by one?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting up a hopefiully simple macro


ok great thank for the help


--
ekafrawy
------------------------------------------------------------------------
ekafrawy's Profile: http://www.excelforum.com/member.php...o&userid=24387
View this thread: http://www.excelforum.com/showthread...hreadid=379764

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting up a hopefiully simple macro


it work great except i need each separeted sentence into a new row not
new column. I don't see an option to do thi

--
ekafraw
-----------------------------------------------------------------------
ekafrawy's Profile: http://www.excelforum.com/member.php...fo&userid=2438
View this thread: http://www.excelforum.com/showthread.php?threadid=37976

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting up a hopefiully simple macro


You will need a macro for that.

You could have some code load the strings into a text array:

Code:
--------------------

Dim myArray() as String
Dim ind as Integer
ind = 1
While Activecell < ""
Redim Preserve myArray(ind)
t = Activecell.Value
for x = 1 to Len(t)
if Mid$(t,x,1) = "*" And myArray(ind) < "" Then
ind = ind + 1 ' only increments on first asterisk
elseif Mid$(t,x,1) < "*" Then
myArray(ind) = myArray(ind) & Mid$(t,x,1)
end if
next x
Selection.Offset(1,0).Select
Wend
--------------------

Then dump those array values where you want them...

HTH


--
tkstock


------------------------------------------------------------------------
tkstock's Profile: http://www.excelforum.com/member.php...o&userid=14443
View this thread: http://www.excelforum.com/showthread...hreadid=379764

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
need help setting a simple format to keep rent. setting a format on excel New Users to Excel 2 July 20th 06 12:03 AM
macro setting? kalz Excel Programming 1 February 17th 05 07:50 AM
Very simple ? on setting up tab order Justine[_2_] Excel Programming 4 September 21st 04 07:42 PM
Sending email via macro- setting the importance setting. Julian Milano[_2_] Excel Programming 1 January 20th 04 10:15 PM
setting row in macro pabs Excel Programming 2 December 18th 03 04:55 PM


All times are GMT +1. The time now is 01:23 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"