ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro "text to column" for excel (https://www.excelbanter.com/excel-programming/373496-macro-text-column-excel.html)

[email protected]

macro "text to column" for excel
 
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

macro "text to column" for excel
 
Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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

[email protected]

macro "text to column" for excel
 
Dave,
I want the result to start with the cell that I am in. Because I am using
tab delimiteded. It then writes across the columns as needed. Can I email
you directly the macro and have you look at it? And thanks
George

"Dave Peterson" wrote:

Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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

macro "text to column" for excel
 
If you want to start in the original location, then try the top suggestion.

If it doesn't work, try posting your code and if you relied on the selection,
post what was in the selection and the selection's address.

wrote:

Dave,
I want the result to start with the cell that I am in. Because I am using
tab delimiteded. It then writes across the columns as needed. Can I email
you directly the macro and have you look at it? And thanks
George

"Dave Peterson" wrote:

Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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

[email protected]

macro "text to column" for excel
 

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


[email protected]

macro "text to column" for excel
 
I justed posted the macro that I have built. Also, the text I am trying to
spread across columns contains a name, address, city, state, and zip which
are all separated by commas.

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



Thanks

"Dave Peterson" wrote:

If you want to start in the original location, then try the top suggestion.

If it doesn't work, try posting your code and if you relied on the selection,
post what was in the selection and the selection's address.

wrote:

Dave,
I want the result to start with the cell that I am in. Because I am using
tab delimiteded. It then writes across the columns as needed. Can I email
you directly the macro and have you look at it? And thanks
George

"Dave Peterson" wrote:

Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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


Tom Ogilvy

macro "text to column" for excel
 
Sub T()
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

Note that Dave wasn't kidding around with that period in front of "CELLS" in
his example. He was serious as a heart attack.

--
Regards,
Tom Ogilvy


" wrote:

I justed posted the macro that I have built. Also, the text I am trying to
spread across columns contains a name, address, city, state, and zip which
are all separated by commas.

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



Thanks

"Dave Peterson" wrote:

If you want to start in the original location, then try the top suggestion.

If it doesn't work, try posting your code and if you relied on the selection,
post what was in the selection and the selection's address.

wrote:

Dave,
I want the result to start with the cell that I am in. Because I am using
tab delimiteded. It then writes across the columns as needed. Can I email
you directly the macro and have you look at it? And thanks
George

"Dave Peterson" wrote:

Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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


Tom Ogilvy

macro "text to column" for excel
 
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


[email protected]

macro "text to column" for excel
 
Tom,
I also realized my error and put the period back into tthe MAcro, and I
still could not get it to execute. I must be overlooking something else.
Thanks
G.


"Tom Ogilvy" wrote:

Sub T()
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

Note that Dave wasn't kidding around with that period in front of "CELLS" in
his example. He was serious as a heart attack.

--
Regards,
Tom Ogilvy


" wrote:

I justed posted the macro that I have built. Also, the text I am trying to
spread across columns contains a name, address, city, state, and zip which
are all separated by commas.

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



Thanks

"Dave Peterson" wrote:

If you want to start in the original location, then try the top suggestion.

If it doesn't work, try posting your code and if you relied on the selection,
post what was in the selection and the selection's address.

wrote:

Dave,
I want the result to start with the cell that I am in. Because I am using
tab delimiteded. It then writes across the columns as needed. Can I email
you directly the macro and have you look at it? And thanks
George

"Dave Peterson" wrote:

Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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


Tom Ogilvy

macro "text to column" for excel
 
Is it because it turned red in the editor - there was a missed space in the
code

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

or you fixed that and it didn't parse the data
because it worked fine for me with the above. (which just added the missing
space)

--
Regards,
Tom Ogilvy



" wrote:

Tom,
I also realized my error and put the period back into tthe MAcro, and I
still could not get it to execute. I must be overlooking something else.
Thanks
G.


"Tom Ogilvy" wrote:

Sub T()
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

Note that Dave wasn't kidding around with that period in front of "CELLS" in
his example. He was serious as a heart attack.

--
Regards,
Tom Ogilvy


" wrote:

I justed posted the macro that I have built. Also, the text I am trying to
spread across columns contains a name, address, city, state, and zip which
are all separated by commas.

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



Thanks

"Dave Peterson" wrote:

If you want to start in the original location, then try the top suggestion.

If it doesn't work, try posting your code and if you relied on the selection,
post what was in the selection and the selection's address.

wrote:

Dave,
I want the result to start with the cell that I am in. Because I am using
tab delimiteded. It then writes across the columns as needed. Can I email
you directly the macro and have you look at it? And thanks
George

"Dave Peterson" wrote:

Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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


Dave Peterson

macro "text to column" for excel
 
Just to add to Tom's reply <bg:

Notice the "With Selection" statement.

That means those things that start with a dot (like .texttocolumns or
..cells(1)), belong to the object that is in the preceding "with" statement. In
this case, that object is the selection.

So the code is equivalent to:

selection.texttocolumns destination:=selection.cells(1), ...

So this means your code will try to do the texttocolumns and put the output in
the range that starts in the first cell in the selection. (selection.cells(1)
is that first cell.)

(Try copying Tom's code and paste it as a direct replacement for that routine.
Then test it out a few times.)

wrote:

Tom,
I also realized my error and put the period back into tthe MAcro, and I
still could not get it to execute. I must be overlooking something else.
Thanks
G.

"Tom Ogilvy" wrote:

Sub T()
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

Note that Dave wasn't kidding around with that period in front of "CELLS" in
his example. He was serious as a heart attack.

--
Regards,
Tom Ogilvy


" wrote:

I justed posted the macro that I have built. Also, the text I am trying to
spread across columns contains a name, address, city, state, and zip which
are all separated by commas.

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



Thanks

"Dave Peterson" wrote:

If you want to start in the original location, then try the top suggestion.

If it doesn't work, try posting your code and if you relied on the selection,
post what was in the selection and the selection's address.

wrote:

Dave,
I want the result to start with the cell that I am in. Because I am using
tab delimiteded. It then writes across the columns as needed. Can I email
you directly the macro and have you look at it? And thanks
George

"Dave Peterson" wrote:

Maybe one of these will help:

With Selection
.TextToColumns Destination:=.cells(1), ....
....

With Selection
.TextToColumns Destination:=.cells(1).offset(0, 1), ....
....


I'm not sure where the results should be placed--start in the original
selection, or start in one column over.



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


--

Dave Peterson

[email protected]

macro "text to column" for excel
 
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

macro "text to column" for excel
 
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

[email protected]

macro "text to column" for excel
 
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

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


All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com