LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default macro "text to column" for excel

Use the mouse to "paint" over the cells that you want.

Or click on the topmost cell. Then shift click on the bottom most cell.

Remember you can only use a single column with your code.

wrote:

How do I select a range, when I am trying to use the cell I am in?

"Dave Peterson" wrote:

Tom's code still worked ok for me:

Option Explicit
Sub testme()
With Selection
.TextToColumns _
Destination:=.Cells(1), _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, _
Tab:=False, _
Semicolon:=False, _
Comma:=True, _
Space:=False, _
Other:=False, _
FieldInfo:=Array(1, 1)
End With
End Sub

Make sure you select your range first.

wrote:

Tom, Dave
I am batting zero..

Task:
81 GREEN HILL ROAD, CHESTER, NJ, 07930

I am trying to run a macro for the above example, for a result that using
"text to column" puts the adress, city state and zip in separate columns.
Also, my 1st cell is the cell with all the information before I run the
macro. Text to column works a cell at a time, I can't get a macro to automate
the task and I have nearly 4000 lines.

Looking for assistance.

my current macro reads as follows:

Sub T()
'
' T Macro
' Macro recorded 9/22/2006 by George Crain
'
' Keyboard Shortcut: Ctrl+a
'
Selection.TextToColumns Destination:=.cells(1), DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1)
End Sub

"Tom Ogilvy" wrote:

see correction posted in your thread.

--
Regards,
Tom Ogilvy


" wrote:


Sub T()
'
' T Macro
' Macro recorded 9/22/2006 by George Crain
'
' Keyboard Shortcut: Ctrl+a
'
Selection.TextToColumns Destination:=cells(1), DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1)
End Sub

The above MACRO does not execute. I am trying take 1 cell of text data, and
spread it (comma delimited) across 4 cells using the original cell I am in.

Thanks in advance for your help.
G. Crain




" wrote:

I want to automate the "text to column" function. I can created the macro;
however, when I rerun the macro on a new row/cell, it writes back to the
previous row/cell and overwrites what is there.

I need the macro to run in the new row/cell where my cursor is, and then not
rewrite back to any previous work.

Thanks
George Crain


--

Dave Peterson


--

Dave Peterson
 
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
how i convert "100" to "hundred"( number to text) in excel-2007 mohanraj Excel Worksheet Functions 1 May 11th 08 09:07 PM
How do I change the column heading in Excel to display "A" "B" "C Thai New Users to Excel 1 November 30th 07 08:06 PM
How do I split "A1B2" into "A1" and "B2" using text to column fun. Jennifer Excel Programming 1 February 2nd 05 10:01 PM
Sending macro based e-mail with built-in "Heading" and "Text" Prabha Excel Programming 3 January 17th 05 02:11 PM


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