+ Reply to Thread
Results 1 to 15 of 15

loop execution not perfect

  1. #1
    Registered User
    Join Date
    10-11-2024
    Location
    india
    MS-Off Ver
    2019
    Posts
    7

    loop execution not perfect

    hello sir i am developing excel vba routine for printing invoice data
    i want to fetch the particular data range from data table ( frmbill sheet data table ) to farmerbill
    related invoice no. entered on farmerbill sheet

    I do some work but it does not go perfect

    can anybody help me
    you can email me to understand problem

    i am atteching worksheet

    thanks
    ajitvyas
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,131

    Re: loop execution not perfect

    Welcome to the Forum ajitvyas!

    Please tell us:

    1. How to run the macro that has the problem
    2. What you want the macro to do
    3. What it does instead (that is, what is not perfect? What is the problem?)
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-11-2024
    Location
    india
    MS-Off Ver
    2019
    Posts
    7

    Re: loop execution not perfect

    Dear sir,
    thanks for answering me, i wish to copy value of range from frm table sheet paste the same in farmer bill sheet below the head of amount, qty rate and buyer name as i entered invoice no in cell b9 in farmer bill entered
    for example if i entered invoice no 570 in b9 cell for farmer bill sheet, it should fetch the invoice no 570 related data from frm table .if there are two times of 570 then all the two times record should be paste.
    my code does work one time(one line of data it does not took another 570 no in counts.
    it is still in developing stage you can f5 switch to run the macro
    open module 4 this code

    can you solve it ?
    thanks in advance
    Last edited by ajitvyas; 10-12-2024 at 01:34 AM. Reason: some lines are notcelar

  4. #4
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    536

    Re: loop execution not perfect

    I think this does what you want.
    Please Login or Register  to view this content.
    Best Regards,
    Maras.

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,995

    Re: loop execution not perfect

    Another Option...
    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  6. #6
    Registered User
    Join Date
    10-11-2024
    Location
    india
    MS-Off Ver
    2019
    Posts
    7

    Re: loop execution not perfect

    thanks all for replying me , i am out of station and i will applying these help when i reach my office mean while

    following is code that i made this work one time only
    i wish all you will see this and correct it
    thanks again
    ajit vyas
    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 10-14-2024 at 09:24 AM. Reason: please use code tags

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,131

    Re: loop execution not perfect

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however we recommend that you include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.

    I have added them for you because you are new.

  8. #8
    Registered User
    Join Date
    10-11-2024
    Location
    india
    MS-Off Ver
    2019
    Posts
    7

    Re: loop execution not perfect

    Dear sir,
    thanks for help me
    but i can not understant the code
    can you explain me ?
    Thanks

  9. #9
    Registered User
    Join Date
    10-11-2024
    Location
    india
    MS-Off Ver
    2019
    Posts
    7

    Re: loop execution not perfect

    Quote Originally Posted by Sintek View Post
    Another Option...
    Please Login or Register  to view this content.
    DEAR SIR
    i really thanks for providing help . code work properly and gives result as i want
    as i am biginner in programming i do not understand some lines but it works nice
    if you provide some knoledge last three line it will be more oblige me

    thnking you
    ajit vyas

  10. #10
    Registered User
    Join Date
    10-11-2024
    Location
    india
    MS-Off Ver
    2019
    Posts
    7

    Re: loop execution not perfect

    Quote Originally Posted by maras_mak View Post
    I think this does what you want.
    Please Login or Register  to view this content.
    dear sir
    thanks for helping me
    unfortunately it does not work and it stuck in for next loop
    but any thanks for giving knowldeg
    ajit vyas

  11. #11
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,995

    Re: loop execution not perfect

    code work properly and gives result as i want
    Glad to have contributed...tx for rep +

    i do not understand some lines but it works nice
    if you provide some knoledge last three line it will be more oblige me
    Please Login or Register  to view this content.
    Here And Here is some info...
    Last edited by Sintek; 10-17-2024 at 02:53 AM.

  12. #12
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    536

    Re: loop execution not perfect

    ajitvyas. I don't quite understand you. Could you explain it more precisely?
    See the attachment. Everything seems to be working fine to me.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    10-11-2024
    Location
    india
    MS-Off Ver
    2019
    Posts
    7

    Re: loop execution not perfect

    THANKS FOR REPLYING ME
    When i copied your code in module and then i started to check all line one by one with pressing f8
    every this goes good but it does not break for loop started form i ,it runs within loop after entering in
    however thanks for helping me
    as I am biginner in programming i do not know furtherore
    sorry
    thanks
    ajit vyas

  14. #14
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    536

    Re: loop execution not perfect

    After copying the code to the VBA module, go to the 'farmerbill' sheet --> left Alt + F8 --> run the 'billmake_maras' macro.

  15. #15
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,995

    Re: loop execution not perfect

    maras_mak's code works for me...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Slow Execution of a Loop
    By gamenano in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-21-2022, 10:18 AM
  2. [SOLVED] To Get perfect Date
    By majidsiddique in forum Excel General
    Replies: 5
    Last Post: 01-17-2020, 09:49 AM
  3. For Loop Execution Incomplete!!
    By Prady.exd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2018, 01:13 PM
  4. Loop Execution--Questions
    By VBNewb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2011, 01:03 PM
  5. Speeding up the Execution of an SQL query in a VBA loop?
    By gimiv in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2007, 03:31 PM
  6. Stopping repetitive loop execution through user form (or other ide
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-18-2006, 01:00 AM
  7. The Perfect Mix
    By Ronald Cayne in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2005, 02:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1