Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all,
I have a question regarding Excel 2000 (from Office Pro) and the use of Macros. Essentially, i have a spreadsheet containing 20,000 records and i have 3 columns that should be one - the data that was supposed to be in one column has ended up split over 3 columns and i desperately need to fix this but am lost as to how to go about it...? I have created the following Macro which copies the contents of the 2nd and 3rd column into the 1st column but this only works for the first record - would it be possible to make this automatically continue until there is no more data to process...? Sub Ma_Merge3Columns() Range("N1").Select ActiveCell.FormulaR1C1 = "Text Content" Range("M1").Select ActiveCell.FormulaR1C1 = "Text Content" Range("O1").Select ActiveCell.FormulaR1C1 = "" Range("M1").Select ActiveCell.FormulaR1C1 = "Text Content" Range("M1").Select End Sub I would appreciate any advice on this matter... Thanks in advance... Regards, Alex |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Firstly, thanks to Dick Kusleika for replying to my original post regarding how to merge 3 columns in my Excel 2000 spreadsheet. I have a another query related to this that i'm now stuck on... I have realised that as well as merging the 3 columns of data, i need to force some kind of hypen or "seperator" in there so that when the 3 columns of data are merged, the data isnt stuck together making it difficult to understand... You can modify that macro to do what you want, but first you should decide if a macro is appropriate. If you have to do this operation all the time, then a macro would be great. If you just need to do it once, then I would use formulas. Namely, in an unused column put this formula =A1&B1&C1 then fill down 20,000 rows. Copy that column and Paste Special - Values over column A. Then delete the column with the formula. This method works GREAT and i have now only to force a "seperator" into the equation so that when each column is merged, they are seperated by a hypen or something similar... I wont be needing to do this "merging" of columns on a regular basis so i dont mind sticking with the above equation as long as it can also, force a "seperator"... Could you let me know how i would go about trying to achieve this successfully? Many, many thanks for pointing me in the right direction - i hope that this additional request is "doable" and that you can let me know either way...(maybe i need to use a macro if the above isnt possible with a formula)...? Best Regards, Alex |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It's much the same:
=A1&"-"&B1&"-"&C1 ": VB :" wrote in message ... Hello, Firstly, thanks to Dick Kusleika for replying to my original post regarding how to merge 3 columns in my Excel 2000 spreadsheet. I have a another query related to this that i'm now stuck on... I have realised that as well as merging the 3 columns of data, i need to force some kind of hypen or "seperator" in there so that when the 3 columns of data are merged, the data isnt stuck together making it difficult to understand... You can modify that macro to do what you want, but first you should decide if a macro is appropriate. If you have to do this operation all the time, then a macro would be great. If you just need to do it once, then I would use formulas. Namely, in an unused column put this formula =A1&B1&C1 then fill down 20,000 rows. Copy that column and Paste Special - Values over column A. Then delete the column with the formula. This method works GREAT and i have now only to force a "seperator" into the equation so that when each column is merged, they are seperated by a hypen or something similar... I wont be needing to do this "merging" of columns on a regular basis so i dont mind sticking with the above equation as long as it can also, force a "seperator"... Could you let me know how i would go about trying to achieve this successfully? Many, many thanks for pointing me in the right direction - i hope that this additional request is "doable" and that you can let me know either way...(maybe i need to use a macro if the above isnt possible with a formula)...? Best Regards, Alex |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Keeping Formulas Intact While Sorting | Excel Discussion (Misc queries) | |||
Sorting columns while keeping row data intact | New Users to Excel | |||
Merging two columns and keeping the data from both | Excel Worksheet Functions | |||
Adding data to celss but keeping the remaining data intact. | Excel Discussion (Misc queries) | |||
keeping rows intact during sort | Excel Discussion (Misc queries) |