Posts by excellover2012

    Re: Help in Array


    Quote from jindon;758378

    I completely forgot what is this all about, so I need to see the file to test.


    Hello Jindon,


    I was not able to attach the file, is there any way I can send it?


    Thank you.

    Re: Help in Array


    Hello ,


    The 10 data sample rows are :-


    [TABLE="width: 651"]

    [tr]


    [td]

    SN#

    [/td]


    [td]

    I Time

    [/td]


    [td]

    O Time

    [/td]


    [td]

    Reg Code

    [/td]


    [td]

    Ncount

    [/td]


    [td]

    Flocation

    [/td]


    [td]

    Tlocation

    [/td]


    [td]

    Type

    [/td]


    [td]

    1SEQ

    [/td]


    [td]

    New Seq

    [/td]


    [/tr]


    [tr]


    [td]

    SMM104

    [/td]


    [td]

    2055

    [/td]


    [td]

    2225

    [/td]


    [td]

    $ASQL11

    [/td]


    [td]

    132

    [/td]


    [td]

    EEJYA

    [/td]


    [td]

    EER9

    [/td]


    [td]

    311

    [/td]


    [td]

    11008020

    [/td]


    [td]

    11008020

    [/td]


    [/tr]


    [tr]


    [td]

    SNM1056

    [/td]


    [td]

    2200

    [/td]


    [td]

    2330

    [/td]


    [td]

    $ASXL12

    [/td]


    [td]

    155

    [/td]


    [td]

    EEJY9

    [/td]


    [td]

    EER9

    [/td]


    [td]

    32E

    [/td]


    [td]

    11009962

    [/td]


    [td]

    11009962

    [/td]


    [/tr]


    [tr]


    [td]

    SNM865

    [/td]


    [td]

    1035

    [/td]


    [td]

    1955

    [/td]


    [td]

    $AIVP34

    [/td]


    [td]

    382

    [/td]


    [td]

    RYXL

    [/td]


    [td]

    EEDB

    [/td]


    [td]

    700

    [/td]


    [td]

    11009971

    [/td]


    [td]

    11009971

    [/td]


    [/tr]


    [tr]


    [td]

    SNM373

    [/td]


    [td]

    0930

    [/td]


    [td]

    1630

    [/td]


    [td]

    $AQCJ123

    [/td]


    [td]

    298

    [/td]


    [td]

    EEJY1

    [/td]


    [td]

    XMNM

    [/td]


    [td]

    322

    [/td]


    [td]

    11050672

    [/td]


    [td]

    11050672

    [/td]


    [/tr]


    [tr]


    [td]

    SNM1136

    [/td]


    [td]

    0400

    [/td]


    [td]

    0500

    [/td]


    [td]

    $AEJPV12

    [/td]


    [td]

    65

    [/td]


    [td]

    EER9

    [/td]


    [td]

    EEDB

    [/td]


    [td]

    V70

    [/td]


    [td]

    11050689

    [/td]


    [td]

    11050689

    [/td]


    [/tr]


    [tr]


    [td]

    SNM457

    [/td]


    [td]

    0220

    [/td]


    [td]

    0515

    [/td]


    [td]

    $AINMP

    [/td]


    [td]

    416

    [/td]


    [td]

    EER9

    [/td]


    [td]

    H9SS

    [/td]


    [td]

    700

    [/td]


    [td]

    11050728

    [/td]


    [td]

    11050728

    [/td]


    [/tr]


    [tr]


    [td]

    SNM833

    [/td]


    [td]

    0700

    [/td]


    [td]

    1450

    [/td]


    [td]

    $AK1234

    [/td]


    [td]

    384

    [/td]


    [td]

    MKLL6

    [/td]


    [td]

    EER9

    [/td]


    [td]

    713

    [/td]


    [td]

    11050729

    [/td]


    [td]

    11050729

    [/td]


    [/tr]


    [tr]


    [td]

    SNM1052

    [/td]


    [td]

    2000

    [/td]


    [td]

    2130

    [/td]


    [td]

    $AIMVC8

    [/td]


    [td]

    409

    [/td]


    [td]

    EEJY

    [/td]


    [td]

    EER9

    [/td]


    [td]

    700

    [/td]


    [td]

    11050735

    [/td]


    [td]

    11050735

    [/td]


    [/tr]


    [tr]


    [td]

    SNM996

    [/td]


    [td]

    0705

    [/td]


    [td]

    1605

    [/td]


    [td]

    $ANDW7

    [/td]


    [td]

    0

    [/td]


    [td]

    EER9

    [/td]


    [td]

    Z8PD

    [/td]


    [td]

    M1F

    [/td]


    [td]

    11050736

    [/td]


    [td]

    11050736

    [/td]


    [/tr]


    [tr]


    [td]

    SNM838

    [/td]


    [td]

    2315

    [/td]


    [td]

    0730

    [/td]


    [td]

    $AKOPV

    [/td]


    [td]

    328

    [/td]


    [td]

    EER9

    [/td]


    [td]

    WXU81

    [/td]


    [td]

    772

    [/td]


    [td]

    17000106

    [/td]


    [td]

    17000106

    [/td]


    [/tr]


    [/TABLE]

    Thank you.

    Re: Help in Array


    And here is 10 rows of data



    [TABLE="width: 650"]

    [tr]


    [td]

    SMM104

    [/td]


    [TD="align: right"]2055[/TD]
    [TD="align: right"]2225[/TD]

    [td]

    $ASQL11

    [/td]


    [TD="align: right"]132[/TD]

    [td]

    EEJYA

    [/td]


    [td]

    EER9

    [/td]


    [td]

    311

    [/td]


    [TD="align: right"]11008020[/TD]
    [TD="align: right"]11008020[/TD]

    [/tr]


    [tr]


    [td]

    SNM1056

    [/td]


    [TD="align: right"]2200[/TD]
    [TD="align: right"]2330[/TD]

    [td]

    $ASXL12

    [/td]


    [TD="align: right"]155[/TD]

    [td]

    EEJY9

    [/td]


    [td]

    EER9

    [/td]


    [td]

    32E

    [/td]


    [TD="align: right"]11009962[/TD]
    [TD="align: right"]11009962[/TD]

    [/tr]


    [tr]


    [td]

    SNM865

    [/td]


    [TD="align: right"]1035[/TD]
    [TD="align: right"]1955[/TD]

    [td]

    $AIVP34

    [/td]


    [TD="align: right"]382[/TD]

    [td]

    RYXL

    [/td]


    [td]

    EEDB

    [/td]


    [td]

    700

    [/td]


    [TD="align: right"]11009971[/TD]
    [TD="align: right"]11009971[/TD]

    [/tr]


    [tr]


    [td]

    SNM373

    [/td]


    [TD="align: right"]0930[/TD]
    [TD="align: right"]1630[/TD]

    [td]

    $AQCJ123

    [/td]


    [TD="align: right"]298[/TD]

    [td]

    EEJY1

    [/td]


    [td]

    XMNM

    [/td]


    [td]

    322

    [/td]


    [TD="align: right"]11050672[/TD]
    [TD="align: right"]11050672[/TD]

    [/tr]


    [tr]


    [td]

    SNM1136

    [/td]


    [TD="align: right"]0400[/TD]
    [TD="align: right"]0500[/TD]

    [td]

    $AEJPV12

    [/td]


    [TD="align: right"]65[/TD]

    [td]

    EER9

    [/td]


    [td]

    EEDB

    [/td]


    [td]

    V70

    [/td]


    [TD="align: right"]11050689[/TD]
    [TD="align: right"]11050689[/TD]

    [/tr]


    [tr]


    [td]

    SNM457

    [/td]


    [TD="align: right"]0220[/TD]
    [TD="align: right"]0515[/TD]

    [td]

    $AINMP

    [/td]


    [TD="align: right"]416[/TD]

    [td]

    EER9

    [/td]


    [td]

    H9SS

    [/td]


    [td]

    700

    [/td]


    [TD="align: right"]11050728[/TD]
    [TD="align: right"]11050728[/TD]

    [/tr]


    [tr]


    [td]

    SNM833

    [/td]


    [TD="align: right"]0700[/TD]
    [TD="align: right"]1450[/TD]

    [td]

    $AK1234

    [/td]


    [TD="align: right"]384[/TD]

    [td]

    MKLL6

    [/td]


    [td]

    EER9

    [/td]


    [td]

    713

    [/td]


    [TD="align: right"]11050729[/TD]
    [TD="align: right"]11050729[/TD]

    [/tr]


    [tr]


    [td]

    SNM1052

    [/td]


    [TD="align: right"]2000[/TD]
    [TD="align: right"]2130[/TD]

    [td]

    $AIMVC8

    [/td]


    [TD="align: right"]409[/TD]

    [td]

    EEJY

    [/td]


    [td]

    EER9

    [/td]


    [td]

    700

    [/td]


    [TD="align: right"]11050735[/TD]
    [TD="align: right"]11050735[/TD]

    [/tr]


    [tr]


    [td]

    SNM996

    [/td]


    [TD="align: right"]0705[/TD]
    [TD="align: right"]1605[/TD]

    [td]

    $ANDW7

    [/td]


    [TD="align: right"]0[/TD]

    [td]

    EER9

    [/td]


    [td]

    Z8PD

    [/td]


    [td]

    M1F

    [/td]


    [TD="align: right"]11050736[/TD]
    [TD="align: right"]11050736[/TD]

    [/tr]


    [tr]


    [td]

    SNM838

    [/td]


    [TD="align: right"]2315[/TD]
    [TD="align: right"]0730[/TD]

    [td]

    $AKOPV

    [/td]


    [TD="align: right"]328[/TD]

    [td]

    EER9

    [/td]


    [td]

    WXU81

    [/td]


    [td]

    772

    [/td]


    [TD="align: right"]17000106[/TD]
    [TD="align: right"]17000106[/TD]

    [/tr]


    [/TABLE]

    Re: Help in Array


    The test VBA code is :



    The XL file has desks numbered "Desk1" to "Desk8" and desk called "Open" , the above VBA code when it distributes the data the VBA code looks at column D.


    I wish I could send you the file.

    Re: Help in Array


    The end result before/after is the same , i.e the desks will be distributed based on the code , the current VBA code is looking at the column D , I want it to look at column H when it distributes the data to the desks.


    I need to send you the XL file, if you like I can email it to you if no bother.

    Re: Help in Array


    Hello Jindon,


    Thank you Again, Here is the current VB code you kindly provided me back then with little adjustment.


    Thank you.


    May be I did not explain what I really needed in the VB code , but please note that :-


    The current VB code is :-





    What I needed was that the code look at column H and place the data to the correspondence desk


    e.g: if column H data is 77L it places the whole row information in a desk called "A100" , if column H data is 77X then it places it in a desk called "B100" so forth so on.


    A-------B---------- C------- D ------------E---------------F-----------------G--------------H-------I--------------J-------
    SN#----ITime-----OTime---Reg Code---NCount--------FLocation--------Tlocation------Type----1SEQ-------New Seq
    YYA61--0015------1345----$YYA---------223-----------XXVV-------------XXWW--------77L-----6204825----6204825


    your help is really appreciated.


    Thank you.

    Re: Help in Array


    Hello Jindon,


    Please accept my apology , i know your were helping me a lot , in fact, the current VB code was done by you back then.


    thank you.


    May be i did not explain what i really needed in the VB code , but please note that :-


    The current VB code is :-





    What I needed was that the code look at column H and place the data to the correspondence desk


    e.g: if column H data is 77L it places the whole row information in a desk called "A100" , if column H data is 77X then it places it in a desk called "B100" so forth so on.


    A-------B---------- C------- D ----------E---------------F-------------- G---------H-------I--------------J-------
    SN#----ITime-----OTime---Reg Code---NCount------FLocation------Tlocation------Type----1SEQ-------New Seq
    YYA61--0015------1345----$YYA-------223---------XXVV----------XXWW---------77L-----6204825----6204825


    your help is really appreciated.


    Thank you.

    Re: Help in Array


    Thank you Appreciated.


    The above code looks at the value $YYA in column D under the header "Reg Code", I want it to look at column H under the header "Type".

    Re: Help in Array


    Understood Stephen, putting the code in a tag , sorry , I forgot how to use the code tags, is it part of the advanced code insertion process ?


    Thank you for adding it for me. appreciated.

    Re: Help in Array


    Thank you Jindon,


    The before/after result is the same , the VBA array is currently looking at Column D to store the data in the worksheets "A100","Non", "B200" so forth so on.


    What I needed was the array to look at column H to store the data in the above mentioned worksheets.


    Thank you for your kind help.

    Need help please


    The below array is looking at column D , how can I change it to look at column H




    A-------B---------- C------- D ----------E---------------F-------------- G-------------H-------I----------J-------
    SN#----ITime-----OTime---Reg Code---NCount------FLocation------Tlocation------Type---1SEQ-------New Seq
    YYA61--0015------1345----$YYA--------223----------XXVV-----------XXWW---------77L----6204825---6204825




    Thank you for you kind help.

    Re: Distributing data to multiple sheets based on 2 criteria


    Hello Jindon,


    Noticed that the code is selecting the whole range when distributing and copying the data to the desks, the problem with this is that I have data on the other ranges that got copied to the desks which I don't want.


    The data that need to be distributed are in the rows A2:J2


    Is is possible to only distribute/copy the data available in the range A1:J1 only.


    Thanks.

    Re: Distributing data to multiple sheets based on 2 criteria


    This is promising , I will test it and let you know,


    Hey Jindon, I start to doubt whether you are one of our earthly species or a genius machine I am talking to , your prompt answers and tireless reply and help keeps me wondering.


    Which every way :smile: , thank you very much.

    Re: Distributing data to multiple sheets based on 2 criteria


    Hello Jindon,


    The run time error was caused by some data issue, I cleared it and did not experience any run time error any more.

    When testing the code noticed that:-


    In the first rule:-


    1) Any Flight# 20 to 2999 and 9000 to 9099 and has any Reg Code as shown in the list 1 - 7 then these Flights to be distributed to the Desks 1 - 7 regardless of the Trip no.


    The code is not properly distributing the Flight# range when it is 100 – 199 and Reg Code is part of the 1 – 7 categories.

    It is placing these Flight# ranges 100 – 199 in Desk8 instead of distributing them in desks 1 - 7.


    Thank you for your continues support and help.