Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
how i convert "100" to "hundred"( number to text) in excel-2007 | Excel Worksheet Functions | |||
How do I change the column heading in Excel to display "A" "B" "C | New Users to Excel | |||
How do I split "A1B2" into "A1" and "B2" using text to column fun. | Excel Programming | |||
Sending macro based e-mail with built-in "Heading" and "Text" | Excel Programming |