Hi All
I am looking for help this problem. I have data that requires sorting. If the date and the driver matches then move the vehicle and KPL to the same row as per the attached example.
Hope someone can help?
many thanks in advance
Jim
Hi All
I am looking for help this problem. I have data that requires sorting. If the date and the driver matches then move the vehicle and KPL to the same row as per the attached example.
Hope someone can help?
many thanks in advance
Jim
Last edited by jimbob121; 10-23-2010 at 11:56 AM.
AS A PRECAUTION SAVE THE FILE SOMEWHERE ALSO SO THAT THE FILE CAN BE RETRIEVED IF THERE IS A MESS UP.
for easy debugging I have given four macros. all the macros should be parked in a standard module.
BUT YOU NEED RUN ONLY "A_test".
the prefix A is given so that this macro will be the first in the list.
The results are in sheet2(repeat sheet2)
I have left some cosmetic changes like filling up all the column headings in sheet2 as the number of columns is indeterminate depending upon your original data.
I would like to have your comments.
Please Login or Register to view this content.
Please Login or Register to view this content.
Please Login or Register to view this content.
Please Login or Register to view this content.
Many Many thanks
What as superb piece of code!!
The only problems I have is that I have a 100 plus rows to sort. If I add another row I get debug error as follows
Many thanks againPlease Login or Register to view this content.
Jim
Spoke to soon. It works ok if I copy all examples down again, the error states application defined or object defined error.
It must be the values of the actual data I am copying in. An example of the drivers name is Keith Smith and an example of the Vehicle is HX55 LMO.
Last edited by jimbob121; 10-18-2010 at 11:38 AM. Reason: a new coder
Hi VenKat1926
The issue I have seems to be related to the drivers name only. I can change vehicles colum ok. I can not have more than 3 drivers. Is there anyway to change this as I have may have 50 diferrent drivers spread across 100 plus rows.
Many thanks again
Jim
Last edited by jimbob121; 10-18-2010 at 03:07 PM.
or
Please Login or Register to view this content.
snb
Many thanks for your code. Sorry about the delay in responding. Your solution works well be seems to miss the last line data. Many thanks in advance if you look at it.
thanks
jim
Snb
Thanks again for the code. Could you help me a bit further and change the code to out to sheet2 and as mentioned before the code misses the last line of data. I can get round this by adding another line and it works ok
Regards
jim
Change this:
With Cells(20, 1).Resize(UBound(Split(c02, vbCr))+1)
@snb
Thanks you very very much!!
Works great!
Hi snb
Sorry but I have a date issue. When the data is sorted, it reverses the date from UK to US style. i.e dd/mm/yyyy to mm/dd/yyyy this only happens when the date is low enough to fit US style which is why I missed it.
Many thanks for your time again
@snb
Any ideas on date issue?
Many thanks for your time.
()
------
For jj = 1 To UBound(sq, 2)
c01 = c01 & "|" & iif(jj=1,format(sq(j,jj),"m-d-yyyy"),sq(j, jj))
Next
-----
thanks you once again.
Works superb!!
no further relevance
Last edited by snb; 10-23-2010 at 12:40 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks