Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Well I have just tried the sample data and it worked fine.
It might be copying the data from the web that is a problem. Try this data with Dave's original macro. Bh72 R.sol A.tum EbN1 N.euro G.metali PF00013 PF00013 PF00013 PF00013 PF00013 PF00013 PF00015 PF00015 PF00015 PF00015 PF00015 PF00014 PF00023 PF00023 PF00023 PF00023 PF00016 PF00015 PF00027 PF00027 PF00024 PF00027 PF00023 PF00023 PF00028 PF00032 PF00027 PF00032 PF00027 PF00027 PF00032 PF00033 PF00032 PF00033 PF00032 PF00032 PF00033 PF00034 PF00033 PF00034 PF00033 PF00033 PF00034 PF00035 PF00034 PF00035 PF00034 PF00034 PF00035 PF00036 PF00035 PF00036 PF00035 PF00035 -- HTH Bob Phillips (remove nothere from the email address if mailing direct) wrote in message oups.com... I'm using the sample data. After running the macro the results are as follows: Bh72 R.sol A.tum EbN1 N.euro G.metali PF00013 PF00013 PF00013 PF00013 PF00013 PF00013 PF00015 PF00015 PF00015 PF00015 PF00015 PF00014 PF00023 PF00023 PF00023 PF00023 PF00016 PF00015 PF00027 PF00027 PF00024 PF00027 PF00023 PF00023 PF00028 PF00032 PF00027 PF00032 PF00027 PF00027 PF00032 PF00033 PF00032 PF00033 PF00032 PF00032 PF00033 PF00034 PF00033 PF00034 PF00033 PF00033 PF00034 PF00035 PF00034 PF00035 PF00034 PF00034 PF00035 PF00036 PF00035 PF00036 PF00035 PF00035 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Whoa! I had trouble correctly copying and pasting what you put into
Excel, so I just typed up some sample data and it ended up working. Do you have any clue why it won't work with the data from the web, because it unfortunately won't work with the data I'm trying to sort, either. I'm wondering if I need to change some formatting or something of that sort? THANKS A TON for at least bringing me some sanity on this, however! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Figured it out. If there's a space or a "_" at the beginning of ANY of
the data it will not work correctly. I'm just going to have to write something up to reformat the data before I run this. THANKS FOR ALL OF YOUR HELP, IT REALLY IS APPRECIATED! |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Lightbulb: I just changed the value of too_high to equal "___" instead
of "ZZZZZZZZ" and it works like a charm... |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Brian,
interesting because Excel uses it's own collating sequence and the underscores would sort before numbers and letters as long as the cell is not a number. Anyway a problem with the original data from the web is that you are not going to see all characters. I would suggest that you copy from the web page, then use data, text to columns separating on a space, tab and all that with two spaces same as one space. Then the important part, run the TRIMALL macro as found in http://www.mvps.org/dmcritchie/excel/join.htm#trimall I tested with the data you posted (copied from my page) and it got almost the same results as you describe (except for first column). Removing the blanks to start over, running the TrimALL macro and it ran fine. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm wrote in message oups.com... Lightbulb: I just changed the value of too_high to equal "___" instead of "ZZZZZZZZ" and it works like a charm... |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Brian,
modification to macro in http://www.mvps.org/dmcritchie/excel/pushdown.htm sorry for not bothering to also create the code/pushdown.txt but it is one less thing to worry about for updates and it is essentially only one macro of interest and not likely to be copied incorrectly once I've corrected <, , and < in the HTML coding. I wanted to keep the macro understandable but it would be much better to use a string of High Values for testing instead of "ZZZZZZZZZ" so I've changed the line to too_high = application.REPT(CHR(255),20) 'instead of "ZZZZZZZZZZ" Also for retesting there is a pushdown_restart macro specifically to put data back to original test data positions, which I'd forgotten was available. Something else, besides running TrimALL on the data, that you have to watch out for is copying coding from web pages: < less than characters, greater than characters, < not equal as combination of the two " double quotes (which shouldn't be a problem here so I've not changed) I have corrected the HTML coding to use <, >, and <> internally, so that you can copy it correctly. There may also be differences in different browsers if not provided for -- I did not check because it was bad HTML coding anyway, but an HTML syntax checker would probably have flagged bare < Excel operators. Suggest you recopy from the web page because your changing of less than and greater than signs and the characters being tested does not sound correct. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "David McRitchie" wrote in message I tested with the data you posted (copied from my page) and it got almost the same results as you describe (except for first column). Removing the blanks to start over, running the TrimALL macro and it ran fine. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Editing a simple macro | Excel Worksheet Functions | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) |