+ Reply to Thread
Results 1 to 4 of 4

filling a table based on header row name

  1. #1
    Registered User
    Join Date
    10-04-2008
    Location
    Bristol, UK
    Posts
    2

    filling a table based on header row name

    Hi,

    Can you help me with the code below?
    I'm trying to fill a status taken from column b and put it in a table
    in between two time values. the first time value is
    Please Login or Register  to view this content.
    and
    the second is
    Please Login or Register  to view this content.
    . In the table the times are held in row
    1. The status will be sick or holiday etc, if the person is at work
    they have a numeric duty code hence the isnumeric check. Once the
    status has been filled to the time window, the next "c" in the range
    is checked.

    Please Login or Register  to view this content.
    regards,
    Matt
    Last edited by VBA Noob; 10-04-2008 at 02:17 PM.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Matt,
    Please wrap your code.
    And it would help if you explained what is wrong with that code.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    10-04-2008
    Location
    Bristol, UK
    Posts
    2
    Hi,

    Can you help me with the code below?
    I'm trying to fill a status taken from column b and put it in a table
    in between two time values. the first time value is c.offset(0,1) and
    the second is c.offset(0,2). In the table the times are held in row
    1. The status will be sick or holiday etc, if the person is at work
    they have a numeric duty code hence the isnumeric check. Once the
    status has been filled to the time window, the next "c" in the range
    is checked.

    Please Login or Register  to view this content.
    The code below fills the data from the start point (where row 1 matches offset(0,1), but it continues to fill all of the remaining columns in the table and not just those up to where row 1 equals the offset(0,2) value.

    Any help would be appreaciated.

    regards,
    Matt

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The condition in the Do..Loop doesn't change with each iteration of the loop. myOffset needs to be incorperated into the test for the Do.

    Also,myOffset needs to be reset to 0 for each new row, lest the Do Loop start with the myOffset value from the last row.

    If the Offset(0,1) value is present on Row1, but the Offset(0,2) is not, myOffset will increase without limit. A test to make sure that it exits should be added.

    This worked for me.
    Please Login or Register  to view this content.
    You may want change the Do test to
    Please Login or Register  to view this content.
    in order to write to the column that matches the c.Offset(0,2).Value

    I hope this helps.
    Last edited by mikerickson; 10-06-2008 at 09:55 AM.

+ 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. Replies: 1
    Last Post: 08-07-2008, 12:23 AM
  2. Excel 2003: VBA to control Header title based on date in cell B3.
    By jplink49 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2008, 04:05 PM
  3. To formulate a table based off a single row of Pivot data
    By money n da sank in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-31-2008, 11:28 AM
  4. Copying photos based on a lookup table?
    By MrSandman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2008, 01:56 AM
  5. Populate Table 1 based on values in Table 2
    By Alan1981 in forum Excel General
    Replies: 5
    Last Post: 10-22-2007, 04:34 AM

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