+ Reply to Thread
Results 1 to 2 of 2

Loop to offset down a worksheet

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    NE
    MS-Off Ver
    2013
    Posts
    42

    Loop to offset down a worksheet

    In the attached example you find two worksheets. 1.being a report. 2. being an archival sheet. In Module 1 you will see a test code that loops through the "historical" sheet and finds all the contracts associated with the contract number entered into range Q9 of the "Historical" tab. Then fills the corresponding contracts into the table Q13:AA30. This code is working fine. I then have an if statement that fills the commodity and quantity into A10 and E11 on the reports tab. I would then need a additional if statements to step down the report to fill the remaining contracts.

    In Module 2 I have been trying to get the code to bypass the historical table on tab 2 and all the corresponding if statements. What I am trying to do is get the first corresponding contract to fill into A10 and E11 then offset to A13 and E14 and enter the next contract. So on and so forth. this code works fine if I only have a single contract, but I very seldom have a single commodity attached to a contract.

    In Userform3 I have a combobox1 that populates the contract numbers available in column B of the "Historical" tab (currently being populated in Q9 of the "historical" tab). What I am attempting to make work is when the commandbutton1 on userform3 is selected it finds that particular contract number and fills the report for me. I know how to get the code to read off combobox1. I have been trying to test the code in a module before I insert it into the commandbutton1.

    I hope this long drawn out explanation outlines what I am trying to accomplish.

    Any help would be greatly appreciated.

    Regards,

    rlh
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Loop to offset down a worksheet

    Code for combobox

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

+ 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. Using offset to loop?
    By MeggieDoodles in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-22-2015, 03:29 PM
  2. [SOLVED] For..Next, offset, nested loop
    By Gingin8639 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-05-2012, 10:23 AM
  3. VBA Loop & Offset Syntax
    By bgintheusa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2010, 09:06 PM
  4. Using offset with in a loop
    By hoffey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-30-2009, 05:49 PM
  5. Loop with activecell.offset
    By mthomas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2005, 05:29 PM
  6. [SOLVED] Need offset range for loop
    By Joe Fish in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2005, 09:05 PM
  7. [SOLVED] VBA help for DO LOOP and Offset
    By NKeller in forum Excel General
    Replies: 1
    Last Post: 07-04-2005, 08:05 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