Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am working with an index that contains topics and subtopics. I need
to separate the topics and subtopics into column A and B while retaining their order in terms of row position. No delimiters, only difference is subtopics are indented by .25". I have very little experience with macros but tried to record something, but it just keeps moving the same line over to the next column, doesn't seem to find specific formatting. Your assistance is most appreciated, joanietv |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
joanietv brought next idea :
I am working with an index that contains topics and subtopics. I need to separate the topics and subtopics into column A and B while retaining their order in terms of row position. No delimiters, only difference is subtopics are indented by .25". I have very little experience with macros but tried to record something, but it just keeps moving the same line over to the next column, doesn't seem to find specific formatting. Your assistance is most appreciated, joanietv You're going to have to provide more info if you expect anyone to be able to help you with this. For instance... Where is the data located? If in a spreadsheet, what is the layout? Where did the data come from? Can you post a sample for a couple of topics and their respective subtopics? -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 6, 12:29*am, GS wrote:
joanietv brought next idea : I am working with an index that contains topics and subtopics. I need to separate the topics and subtopics into column A and B while retaining their order in terms of row position. No delimiters, only difference is subtopics are indented by .25". I have very little experience with macros but tried to record something, but it just keeps moving the same line over to the next column, doesn't seem to find specific formatting. Your assistance is most appreciated, joanietv You're going to have to provide more info if you expect anyone to be able to help you with this. For instance... Where is the data located? * If in a spreadsheet, what is the layout? Where did the data come from? Can you post a sample for a couple of topics and their respective subtopics? -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc Sorry. Didnt want to get too wordy. Text originally in Word 31 pages like this: above-ground caring for children — See Rule 747.4015 accidents: records*— See Subchapter C, Division 2 creating and keeping a written record — See Rules 747.701, 747.705, 747.709 providing a copy to parents — See Rule 747.707 required form — See Rule 747.703 active play pre-kindergarten — See Rule 747.2507 school-age— See Rule 747.2607 toddlers — See Rule 747.2407 water served after active play — See Rule 747.3101 active play equipment Tried working on it there, but no luck so I transferred to Excel to see if idented lines would come into Column B, but all text copies into Column A. I need to translate the text and then re-alphabetize according to the new language, but have to be able to separate topics and subtopics. Maybe place a delimiter at the beginning of indented lines? But haven't figured out (in Word or Excel) how to do that. Let me know if you need more info. joanietv Does that help? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 6, 8:38*am, joanietv wrote:
On May 6, 12:29*am, GS wrote: joanietv brought next idea : I am working with an index that contains topics and subtopics. I need to separate the topics and subtopics into column A and B while retaining their order in terms of row position. No delimiters, only difference is subtopics are indented by .25". I have very little experience with macros but tried to record something, but it just keeps moving the same line over to the next column, doesn't seem to find specific formatting. Your assistance is most appreciated, joanietv You're going to have to provide more info if you expect anyone to be able to help you with this. For instance... Where is the data located? * If in a spreadsheet, what is the layout? Where did the data come from? Can you post a sample for a couple of topics and their respective subtopics? -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc Sorry. Didnt want to get too wordy. Text originally in Word 31 pages like this: above-ground caring for children — See Rule 747.4015 accidents: records*— See Subchapter C, Division 2 * * creating and keeping a written record — See Rules 747.701, 747.705, 747.709 * * providing a copy to parents — See Rule 747.707 * * required form — See Rule 747.703 active play * * pre-kindergarten — See Rule 747.2507 * * school-age— See Rule 747.2607 * * toddlers — See Rule 747.2407 * * water served after active play — See Rule 747.3101 active play equipment Tried working on it there, but no luck so I transferred to Excel to see if idented lines would come into Column B, but all text copies into Column A. I need to translate the text and then re-alphabetize according to the new language, but have to be able to separate topics and subtopics. Maybe place a delimiter at the beginning of indented lines? But haven't figured out (in Word or Excel) how to do that. Let me know if you need more info. joanietv Does that help?- Hide quoted text - - Show quoted text - Another detail I just remembered... indented text is formatted in different "style" than text that is not indented. Possible to insert delimiter such as "-" at beginning of any text string with that style? Just a thougt... Thanks, joanietv |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
joanietv has brought this to us :
On May 6, 12:29Â*am, GS wrote: joanietv brought next idea : I am working with an index that contains topics and subtopics. I need to separate the topics and subtopics into column A and B while retaining their order in terms of row position. No delimiters, only difference is subtopics are indented by .25". I have very little experience with macros but tried to record something, but it just keeps moving the same line over to the next column, doesn't seem to find specific formatting. Your assistance is most appreciated, joanietv You're going to have to provide more info if you expect anyone to be able to help you with this. For instance... Where is the data located? Â* If in a spreadsheet, what is the layout? Where did the data come from? Can you post a sample for a couple of topics and their respective subtopics? -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc Sorry. Didnt want to get too wordy. Text originally in Word 31 pages like this: above-ground caring for children €” See Rule 747.4015 accidents: recordsÂ*€” See Subchapter C, Division 2 creating and keeping a written record €” See Rules 747.701, 747.705, 747.709 providing a copy to parents €” See Rule 747.707 required form €” See Rule 747.703 active play pre-kindergarten €” See Rule 747.2507 school-age€” See Rule 747.2607 toddlers €” See Rule 747.2407 water served after active play €” See Rule 747.3101 active play equipment Tried working on it there, but no luck so I transferred to Excel to see if idented lines would come into Column B, but all text copies into Column A. I need to translate the text and then re-alphabetize according to the new language, but have to be able to separate topics and subtopics. Maybe place a delimiter at the beginning of indented lines? But haven't figured out (in Word or Excel) how to do that. Let me know if you need more info. joanietv Does that help? You can enter the following formula into ColB for each subtopic. Then select ColB and copy/paste values. Then clear contents in subtopic cells in ColA. =MID(A3,5,LEN(A3)) OR You can run the following macro for each sheet: Sub MoveSubtopics() Dim r As Long, lLastrow As Long lLastrow = ActiveSheet.UsedRange.Rows.Count For r = 1 To lLastrow With Cells(r, "A") If Asc(Left$(.Value, 1)) = 160 Then _ .Offset(, 1) = Mid$(.Value, 5): .ClearContents End With Next 'r End Sub -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 6, 1:00*pm, GS wrote:
joanietv has brought this to us : On May 6, 12:29*am, GS wrote: joanietv brought next idea : I am working with an index that contains topics and subtopics. I need to separate the topics and subtopics into column A and B while retaining their order in terms of row position. No delimiters, only difference is subtopics are indented by .25". I have very little experience with macros but tried to record something, but it just keeps moving the same line over to the next column, doesn't seem to find specific formatting. Your assistance is most appreciated, joanietv You're going to have to provide more info if you expect anyone to be able to help you with this. For instance... Where is the data located? * If in a spreadsheet, what is the layout? Where did the data come from? Can you post a sample for a couple of topics and their respective subtopics? -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc Sorry. Didnt want to get too wordy. Text originally in Word 31 pages like this: above-ground caring for children — See Rule 747.4015 accidents: records*— See Subchapter C, Division 2 * * creating and keeping a written record — See Rules 747.701, 747.705, 747.709 * * providing a copy to parents — See Rule 747.707 * * required form — See Rule 747.703 active play * * pre-kindergarten — See Rule 747.2507 * * school-age— See Rule 747.2607 * * toddlers — See Rule 747.2407 * * water served after active play — See Rule 747.3101 active play equipment Tried working on it there, but no luck so I transferred to Excel to see if idented lines would come into Column B, but all text copies into Column A. I need to translate the text and then re-alphabetize according to the new language, but have to be able to separate topics and subtopics. Maybe place a delimiter at the beginning of indented lines? But haven't figured out (in Word or Excel) how to do that. Let me know if you need more info. joanietv Does that help? You can enter the following formula into ColB for each subtopic. Then select ColB and copy/paste values. Then clear contents in subtopic cells in ColA. * =MID(A3,5,LEN(A3)) OR You can run the following macro for each sheet: Sub MoveSubtopics() * Dim r As Long, lLastrow As Long * lLastrow = ActiveSheet.UsedRange.Rows.Count * For r = 1 To lLastrow * * With Cells(r, "A") * * * If Asc(Left$(.Value, 1)) = 160 Then _ * * * * .Offset(, 1) = Mid$(.Value, 5): .ClearContents * * End With * Next 'r End Sub -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text - - Show quoted text - Garry, Thanks for the quick response. I tried running the macro after copying and pasting one page of index into Excel, but nothing happened. Can you tell me which of the variables/values I may need to tweak to get the macro to "see" my text? Maybe the offset is off? Also, can you tell me what code moves text to column B? Much appreciated, jtv |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I copied/pasted your sample text into A1, then ran the macro. Result
was all subtopics were copied to ColB and cleared from ColA. Is your text in ColA? See below for more comments... above-ground caring for children €” See Rule 747.4015 accidents: recordsÂ*€” See Subchapter C, Division 2 Â* Â* creating and keeping a written record €” See Rules 747.701, 747.705, 747.709 Â* Â* providing a copy to parents €” See Rule 747.707 Â* Â* required form €” See Rule 747.703 active play Â* Â* pre-kindergarten €” See Rule 747.2507 Â* Â* school-age€” See Rule 747.2607 Â* Â* toddlers €” See Rule 747.2407 Â* Â* water served after active play €” See Rule 747.3101 active play equipment You can enter the following formula into ColB for each subtopic. Then select ColB and copy/paste values. Then clear contents in subtopic cells in ColA. Â* =MID(A3,5,LEN(A3)) OR You can run the following macro for each sheet: Sub MoveSubtopics() Â* Dim r As Long, lLastrow As Long Â* lLastrow = ActiveSheet.UsedRange.Rows.Count Â* For r = 1 To lLastrow Â* Â* With Cells(r, "A") 'If a subtopic then move it to ColB, clear ColA Â* Â* Â* If Asc(Left$(.Value, 1)) = 160 Then _ Â* Â* Â* Â* .Offset(, 1) = Mid$(.Value, 5): .ClearContents Â* Â* End With Â* Next 'r End Sub -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MACRO assistance | Excel Discussion (Misc queries) | |||
Macro Assistance | Excel Programming | |||
Macro assistance please | Excel Programming | |||
Macro assistance please - again! | Excel Programming | |||
Macro assistance | Excel Programming |