Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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

  #15   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
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
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 09:19 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"