+ Reply to Thread
Results 1 to 5 of 5

Need help with getting variables filled properly.

  1. #1
    Forum Contributor
    Join Date
    02-05-2021
    Location
    Netherlands
    MS-Off Ver
    Microsoft Excel 365 (version 2022, Build 14931.20764)
    Posts
    180

    Talking Need help with getting variables filled properly.

    Dear forum readers,
    I am having a problem with a VBA program that I wrote (Excel-VBA).

    To start with some context.
    I am a newbie when it comes to programming in VBA, so that been said.. 
    I work in a company that uses a lot of individual files, called bricks.
    All bricks (Excel-files) reside in one folder.

    Each brick (individual file) has a title and subtitle (always the first and second filled row) and a type of the status of the product: (Mainstream, Emerging (R & D), Containment, Retirement).

    For example:
    File(s) --> Brick: Computer client operating system.xls

    Content:
    - Title: Client computers
    - Subtitle: Operating systems

    Followed by the status:
    - Emerging (R & D)
    o Windows 1010
    o Apple IOS 398393
    - Mainstream
    o Windows 10
    o Apple 123
    - Containment
    o Windows 7
    - Retirement
    o Windows 98
    o Commodore 64
    o MSX 2


    I ‘wrote’ a program that:
    - Reads all the Excel files in a specific folder
    - Reads the title and subtitle
    - Reads all rows between (for example) Mainstream and Emerging
    - Puts all gathered information in ONE destination Excel-file (i.e. Title, Subtitle and information between for instance Mainstream and emerging)

    So here is my/the challenge.
    1. Sometimes people are filling the title and subtitle a few rows higher or lower, but it’s always (title first followed by a subtitle).
    o I like to read the first and second non-blank rows.
    o If someone forget to put in a title or subtitle I like to fill the variable with “No title or subtitle found”
    2. Sometimes people are filling information (Emerging, Mainstream, Containment, et cetera) in column B instead or A.
    o I like to fetch the information between (for example) Information and Emerging (the row), even if somebody puts the information in column B, C, D et cetera.

    My ‘program’ works, but not always (sometimes it skips information/row).
    And I know, it looks more like a spaghetti program, so my question is.
    Can anyone help me with this challenge and provide me with some code that is easy to interpret. 

    I added the file (Files have to be placed in C:\Temp\Excel)
    The code resides in file: Destination_File_Summary.xls

    Thank you very much for assistance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-05-2021
    Location
    Netherlands
    MS-Off Ver
    Microsoft Excel 365 (version 2022, Build 14931.20764)
    Posts
    180

    Re: Need help with getting variables filled properly.

    Please Login or Register  to view this content.
    Last edited by NewBee_HS; 02-05-2021 at 12:02 PM. Reason: Adding hash tag

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need help with getting variables filled properly.

    Administrative Note:

    Welcome to the forum.

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

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #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

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    02-05-2021
    Location
    Netherlands
    MS-Off Ver
    Microsoft Excel 365 (version 2022, Build 14931.20764)
    Posts
    180

    Re: Need help with getting variables filled properly.

    Is this okay now?

  5. #5
    Forum Contributor
    Join Date
    02-05-2021
    Location
    Netherlands
    MS-Off Ver
    Microsoft Excel 365 (version 2022, Build 14931.20764)
    Posts
    180

    Re: Need help with getting variables filled properly.

    Nobody?

+ 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. [SOLVED] I need to make a list of products requested that is filled if the cell is filled
    By ButterLord in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 09-21-2020, 09:55 AM
  2. How to properly loop a subroutine with multiple dim variables
    By qualk23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2020, 07:11 AM
  3. [SOLVED] Jagged dictionary or collection filled via variables
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2017, 12:10 PM
  4. [SOLVED] if Row A contains text, SUM all filled in from row A, and show number of filled in in A150
    By jeroenheki in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-12-2012, 06:23 AM
  5. Replies: 12
    Last Post: 07-10-2012, 05:04 PM
  6. Excel 2007 : Cant pass variables properly
    By grizzlypete44 in forum Excel General
    Replies: 4
    Last Post: 12-01-2011, 09:51 AM
  7. macro for a form properly filled
    By corchox in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2010, 10:53 PM

Tags for this Thread

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