Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default macro to move part of cell contents to another cell

I've been trying to program a macro to search for all text after a colon (:)
and move that text to an adjacent empty cell. I've been able to get it to
search, but from that point on it will only paste what is already on the
clipboard instead of copying new text.

What am I missing? Or is it evenpossible?
--
Bring them home now
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default macro to move part of cell contents to another cell

Sure, As always, post YOUR code for comments. You should also provide
details of what you are trying to do.

--
Don Guillett
SalesAid Software

"icetoad hisself" wrote in
message ...
I've been trying to program a macro to search for all text after a colon
(:)
and move that text to an adjacent empty cell. I've been able to get it to
search, but from that point on it will only paste what is already on the
clipboard instead of copying new text.

What am I missing? Or is it evenpossible?
--
Bring them home now



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default macro to move part of cell contents to another cell


Sub Macro1()
Application.DisplayAlerts = False
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited,
_
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=True, Comma:=False, Space:=False, Other:=True,
OtherChar:= _
":", FieldInfo:=Array(Array(1, 1), Array(2, 1))
End Sub

When using macro recorder un text to columns, especially if you are
using : as a delimiter

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default macro to move part of cell contents to another cell

Hi.
You can do it without a macro. If your text (containing a colon) is in
A2, put =RIGHT(A2,LEN(A2)-FIND(":",A2)) in B2 to get the text after the
colon. If there are cells without a colon, you get a #value error, so
if necessary wrap it in an if statement like this
=IF(ISERROR(FIND(":",A2)),"",RIGHT(A2,LEN(A2)-FIND(":",A2)))
That will return a blank if there is no colon in A2.

Len

icetoad hisself wrote:
I've been trying to program a macro to search for all text after a colon (:)
and move that text to an adjacent empty cell. I've been able to get it to
search, but from that point on it will only paste what is already on the
clipboard instead of copying new text.

What am I missing? Or is it evenpossible?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default macro to move part of cell contents to another cell

You could add a new column to the right of your column, choose the column you
want to separate, and choose Data/Text to Columns and choose "Other" as a
delimiter and insert a colon there. Done!

"icetoad hisself" wrote:

I've been trying to program a macro to search for all text after a colon (:)
and move that text to an adjacent empty cell. I've been able to get it to
search, but from that point on it will only paste what is already on the
clipboard instead of copying new text.

What am I missing? Or is it evenpossible?
--
Bring them home now

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
Recorded macro has hard cell contents. DocBrown Excel Discussion (Misc queries) 4 August 11th 06 07:16 PM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
move cell contents David L Excel Discussion (Misc queries) 13 November 24th 05 08:18 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


All times are GMT +1. The time now is 05:31 PM.

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

About Us

"It's about Microsoft Excel"