Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hello,
I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle |
#2
![]() |
|||
|
|||
![]()
Hi Mirandolle,
You dont need to use macro for your problem,assuming your data is in column "A" what you can do is just tag the adjacent colum "B" : \en \fr Blank and copy the tag till the last row of colum A In colum "C" use the concencate formula and that will give you your data. then just copy and past special values Colum C to colum A and yr data is ready. To add one more row can be done by adding number is adjesent row and then sorting and then again updating the sequence number bt adding a text with a multiple of 3 for example 3A,6A,7A "Mirandolle" wrote: Hello, I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle |
#3
![]() |
|||
|
|||
![]()
Hi Hitesh,
Thank you very much for your answer !! :-) But, I am not sure to understand you... Point by point: 1- the English and French words are already entered... so I have a VERY looong list... to add a column with : \en \fr Blank \en \fr Blank etc.... will be quite long (no ?) 2- I want the tags to be in front of the words. If I add \en and \fr tags to column B (on the right side of A column), I will get something like : house \en maison \fr blank Isn't it ? (\en and \fr should be at the start of each line) Sorry for all these questions, but I am really bad at Excel... :-( HITESH wrote: Hi Mirandolle, You dont need to use macro for your problem,assuming your data is in column "A" what you can do is just tag the adjacent colum "B" : \en \fr Blank and copy the tag till the last row of colum A In colum "C" use the concencate formula and that will give you your data. then just copy and past special values Colum C to colum A and yr data is ready. To add one more row can be done by adding number is adjesent row and then sorting and then again updating the sequence number bt adding a text with a multiple of 3 for example 3A,6A,7A "Mirandolle" wrote: Hello, I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle |
#4
![]() |
|||
|
|||
![]()
#1. Type in one group of 3 values (\en, \fr, (blank)), then select all three
and drag it down the column by using the autofill button in the bottom right corner of that selection. (It won't take too long.) #2. After you have your new data in column B, insert a new column C: put this in the top 3 cells: =b1&" "&a1 =b2&" "&a2 (leave blank) And drag down the column like you did for column B. #3. Select column C Edit|copy edit|paste special|values Delete columns A:B (if it worked ok) Mirandolle wrote: Hi Hitesh, Thank you very much for your answer !! :-) But, I am not sure to understand you... Point by point: 1- the English and French words are already entered... so I have a VERY looong list... to add a column with : \en \fr Blank \en \fr Blank etc.... will be quite long (no ?) 2- I want the tags to be in front of the words. If I add \en and \fr tags to column B (on the right side of A column), I will get something like : house \en maison \fr blank Isn't it ? (\en and \fr should be at the start of each line) Sorry for all these questions, but I am really bad at Excel... :-( HITESH wrote: Hi Mirandolle, You dont need to use macro for your problem,assuming your data is in column "A" what you can do is just tag the adjacent colum "B" : \en \fr Blank and copy the tag till the last row of colum A In colum "C" use the concencate formula and that will give you your data. then just copy and past special values Colum C to colum A and yr data is ready. To add one more row can be done by adding number is adjesent row and then sorting and then again updating the sequence number bt adding a text with a multiple of 3 for example 3A,6A,7A "Mirandolle" wrote: Hello, I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle -- Dave Peterson |
#5
![]() |
|||
|
|||
![]()
Thank you very much Dave ! I am going to try immediately.
In fact, the result I would like to get is a little bit complicated, so I made two short sample excel files to show what I need to do. Here, the list I have at the begining: http://cjoint.com/?igppXa1zeI And here the result I try to reach: http://cjoint.com/?igpqw3BNgn So at the begining I have a long list without space in A column: [English Word] [French Word] [English Word] [French Word] [English Word] [French Word] etc. And I try 1- to add a marker in front of each word (for my database and to export the list); 2- to add an empty line between each couple of word; 3- to add another line between [English word] and [French Word], just to indicate the vocabular category. So the result is (markers are in column A, words are in Column B): \lx [English Word] \ps "Names of flowers" \gn [French Word] \lx [English Word] \ps "Names of flowers" \gn [French Word] \lx [English Word] \ps "Names of flowers" \gn [French Word] etc. Well, but may be there is no need to use a macro for all the operation (I can move easily the words definition from column A to B, etc.), so I am trying right now the tips you showed me. Thank you again ! Dave Peterson wrote: #1. Type in one group of 3 values (\en, \fr, (blank)), then select all three and drag it down the column by using the autofill button in the bottom right corner of that selection. (It won't take too long.) #2. After you have your new data in column B, insert a new column C: put this in the top 3 cells: =b1&" "&a1 =b2&" "&a2 (leave blank) And drag down the column like you did for column B. #3. Select column C Edit|copy edit|paste special|values Delete columns A:B (if it worked ok) Mirandolle wrote: Hi Hitesh, Thank you very much for your answer !! :-) But, I am not sure to understand you... Point by point: 1- the English and French words are already entered... so I have a VERY looong list... to add a column with : \en \fr Blank \en \fr Blank etc.... will be quite long (no ?) 2- I want the tags to be in front of the words. If I add \en and \fr tags to column B (on the right side of A column), I will get something like : house \en maison \fr blank Isn't it ? (\en and \fr should be at the start of each line) Sorry for all these questions, but I am really bad at Excel... :-( HITESH wrote: Hi Mirandolle, You dont need to use macro for your problem,assuming your data is in column "A" what you can do is just tag the adjacent colum "B" : \en \fr Blank and copy the tag till the last row of colum A In colum "C" use the concencate formula and that will give you your data. then just copy and past special values Colum C to colum A and yr data is ready. To add one more row can be done by adding number is adjesent row and then sorting and then again updating the sequence number bt adding a text with a multiple of 3 for example 3A,6A,7A "Mirandolle" wrote: Hello, I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle |
#6
![]() |
|||
|
|||
![]()
I don't open attachments or links. (lots of people won't.)
If you don't get a volunteer to look at your files, you may want to repost in plain text. Mirandolle wrote: Thank you very much Dave ! I am going to try immediately. In fact, the result I would like to get is a little bit complicated, so I made two short sample excel files to show what I need to do. Here, the list I have at the begining: http://cjoint.com/?igppXa1zeI And here the result I try to reach: http://cjoint.com/?igpqw3BNgn So at the begining I have a long list without space in A column: [English Word] [French Word] [English Word] [French Word] [English Word] [French Word] etc. And I try 1- to add a marker in front of each word (for my database and to export the list); 2- to add an empty line between each couple of word; 3- to add another line between [English word] and [French Word], just to indicate the vocabular category. So the result is (markers are in column A, words are in Column B): \lx [English Word] \ps "Names of flowers" \gn [French Word] \lx [English Word] \ps "Names of flowers" \gn [French Word] \lx [English Word] \ps "Names of flowers" \gn [French Word] etc. Well, but may be there is no need to use a macro for all the operation (I can move easily the words definition from column A to B, etc.), so I am trying right now the tips you showed me. Thank you again ! Dave Peterson wrote: #1. Type in one group of 3 values (\en, \fr, (blank)), then select all three and drag it down the column by using the autofill button in the bottom right corner of that selection. (It won't take too long.) #2. After you have your new data in column B, insert a new column C: put this in the top 3 cells: =b1&" "&a1 =b2&" "&a2 (leave blank) And drag down the column like you did for column B. #3. Select column C Edit|copy edit|paste special|values Delete columns A:B (if it worked ok) Mirandolle wrote: Hi Hitesh, Thank you very much for your answer !! :-) But, I am not sure to understand you... Point by point: 1- the English and French words are already entered... so I have a VERY looong list... to add a column with : \en \fr Blank \en \fr Blank etc.... will be quite long (no ?) 2- I want the tags to be in front of the words. If I add \en and \fr tags to column B (on the right side of A column), I will get something like : house \en maison \fr blank Isn't it ? (\en and \fr should be at the start of each line) Sorry for all these questions, but I am really bad at Excel... :-( HITESH wrote: Hi Mirandolle, You dont need to use macro for your problem,assuming your data is in column "A" what you can do is just tag the adjacent colum "B" : \en \fr Blank and copy the tag till the last row of colum A In colum "C" use the concencate formula and that will give you your data. then just copy and past special values Colum C to colum A and yr data is ready. To add one more row can be done by adding number is adjesent row and then sorting and then again updating the sequence number bt adding a text with a multiple of 3 for example 3A,6A,7A "Mirandolle" wrote: Hello, I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle -- Dave Peterson |
#7
![]() |
|||
|
|||
![]()
Hi Mirandolle,
I believe Hitesh's solution will work, but you may not fully understand what he was trying to tell you. Try this macro. It assumes you data is in column A. Sub AddToIt() Dim i As Long Range("A1").Select i = Range("A65000").End(xlUp).Row For i = 1 To i If ActiveCell.Value < "" Then ActiveCell.Value = "\en " & ActiveCell.Value ActiveCell.Offset(1, 0).Select ActiveCell.Value = "\fr " & ActiveCell.Value ActiveCell.Offset(1, 0).Select ElseIf ActiveCell.Value = "" Then Selection.EntireRow.Insert ActiveCell.Offset(2, 0).Select If ActiveCell.Value = "" Then Exit Sub End If End If Next End Sub HTH Regards, Howard "Mirandolle" wrote in message ... Hello, I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle |
#8
![]() |
|||
|
|||
![]()
L. Howard Kittle wrote:
I believe Hitesh's solution will work, but you may not fully understand what he was trying to tell you. You're right, and I am sorry! I cannot catch the point because I never use Excel :-( I have a lot experience with Word, but I never use macro. Try this macro. It assumes you data is in column A. Yes wonderful ! It makes the biggest part of the work! Thank you so much! I found another Macro to add a blank line beetween each couple of word. The Macro is: Sub ajoutdeligne() Dim i As Long, x As Long, lr As Long x = ActiveSheet.UsedRange.Rows.Count lr = ActiveCell.SpecialCells(xlLastCell).Row If 3 lr Then Exit Sub If lr / 2 = Int(lr / 2) Then lr = lr + 1 For i = lr To 3 Step -2 Rows(i).EntireRow.Insert Next i End Sub With your macro and this macro, I can get this: \en [english word] \fr [french word] [emplty line] \en [english word] \fr [french word] [empty] \en [english word] \fr [french word] etc... The last point: If I want to add a line BETWEEN "\en [english word]" AND "\fr [french word]", how to do ? (I want to add the same line each time: "\cat common name") I would like to get: \en [english word] \cat Common name \fr [french word] [emplty line] \en [english word] \ps Common name \fr [french word] [empty] \en [english word] \ps Common name \fr [french word] etc. You can have a look to the result I am trying to get he http://cjoint.com/?igpqw3BNgn \en \fr or \lx \ps, etc. are just marker, I can change them myself. Next, it is not important if markers and words are all in column A (or separated in A and B), because I will export the file onto a new text format (database file), so it's even better to keep all in one column. Your macro do a great job! Dave's tip is working to, to I keep on making a few tests... Thank you very much for your kind help ! Sub AddToIt() Dim i As Long Range("A1").Select i = Range("A65000").End(xlUp).Row For i = 1 To i If ActiveCell.Value < "" Then ActiveCell.Value = "\en " & ActiveCell.Value ActiveCell.Offset(1, 0).Select ActiveCell.Value = "\fr " & ActiveCell.Value ActiveCell.Offset(1, 0).Select ElseIf ActiveCell.Value = "" Then Selection.EntireRow.Insert ActiveCell.Offset(2, 0).Select If ActiveCell.Value = "" Then Exit Sub End If End If Next End Sub HTH Regards, Howard "Mirandolle" wrote in message ... Hello, I understand nothing to macro but I am sure that a macro can resolve my problem. I have the following columns, for example (it is for a dictionary database): House Maison [empty line] Car Voiture [empty line] Dog Chien [empty line] etc..... The first word is always in English and the second is always french. There is only 1 column but many lines. I would like to add "\en" in front of each English word, and "\fr" in front of each French word (in the same cell - I do not want to add a colum)... as a result I should get : \en House \fr Maison \en Car \fr Voiture \en Dog \fr Chien etc..... Could someone give me a macro for that ? hum.. if I do not abuse :-/ ... which macro would do this (if I want to add another line:) \en House \nnoun \fr Maison \en Car \noun \fr Voiture \en Dog \noun \fr Chien etc... A big THANKS! for any help! :-) Miradonlle |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number to words literal | Excel Worksheet Functions | |||
soft-coding lines in a macro | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
macro to eliminate spaces between words | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) |