+ Reply to Thread
Results 1 to 6 of 6

How To Convert Recorded Macro To Loop Until No Data On Next Row?

  1. #1
    Forum Contributor
    Join Date
    01-29-2015
    Location
    .
    MS-Off Ver
    2010
    Posts
    313

    How To Convert Recorded Macro To Loop Until No Data On Next Row?

    I'm pretty sure this question is ask a lot on this forum but I am still new to VBA and trying to learn the ways of programming. I have just completed recording a macro and realized it's not going to work because my raw data will always be changing row count. Can someone tell me how you insert functions in your macro to loop it? I hope i'm explaining that well enough. Here is my macro I need to loop but I would like to know how to do this on my own if it ever happens again.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How To Convert Recorded Macro To Loop Until No Data On Next Row?

    Hi,

    Please upload the workbook rather than a text file.

    In addition please indicate what is the overall aim. Don't tell us what your macro is doing, leave us to decide what's the best way to achieve your goal. Almost certainly your recorded macro will contain a lot of stuff that's not necessary and maybe not even be the most efficient way of achieving your aim.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    01-29-2015
    Location
    .
    MS-Off Ver
    2010
    Posts
    313

    Re: How To Convert Recorded Macro To Loop Until No Data On Next Row?

    Please see attachments. I start off with the Open ASNs spreadsheet. It is just basically formatting for the most part but the reports constantly change in row count.
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How To Convert Recorded Macro To Loop Until No Data On Next Row?

    What determines which of the 952 data rows are extracted from the Ope ASN file to populate the much smaller number of rows in the Evaluation Report?

  5. #5
    Forum Contributor
    Join Date
    01-29-2015
    Location
    .
    MS-Off Ver
    2010
    Posts
    313

    Re: How To Convert Recorded Macro To Loop Until No Data On Next Row?

    Attached is a spread sheet I really need help with. The first sheet's "Evaluation Report" and the 3rd sheet's "ZP4RN" raw data is always changing and I don't know how to set up a macro to format it based off content in each cell. The sheets inbetween are the the raw data reports I run daily. I only formatted two blocks of the work sheet in "Evaluation Report" to show you the patterns of colors I would like for each Block of data if it is possible and rotate between the two styles for each block of data . The blocks change in row count every time I run the report so it makes it difficult to format and is very time consuming but there are common things in each block that remain the same which I will list below. Once the macro is completed the raw data sheets wont need to be in the spreadsheet. This is just so you can see what the before and semi after looks like. Besides the formatting I need a formula or macro in the ZP4RN spreadsheet in column J that indexes the value in column B "Material", locates in column D in the "Evaluation Report" finds the value in Q and if that value is greater than or equal to 10 insert text "Needs to be reviewed" back in column J. Please keep in mind that the row count in both reports change. Thanks any one who can help!

    Evaluation Report:
    Formatting needed
    Common data in a "Block" of data is it always starts with Purchase organization in column B and ends when you see the next purchasing organzation in column B. I would like at least one space inbetween them. The word "Schedule Agreement" is always 8 rows down from the word purchasing organization and two columns to the right. Below that if there is a number that starts with 181 in column E it will have Last ASN written out beside and so on . I think the rest of the formatting is pretty self explanatory but I hope this helps!

    ZP4RN:
    Formatting needed
    Formula in Column J needed

  6. #6
    Forum Contributor
    Join Date
    01-29-2015
    Location
    .
    MS-Off Ver
    2010
    Posts
    313

    Re: How To Convert Recorded Macro To Loop Until No Data On Next Row?

    I actually attached the wrong evaluation report! This is the correct one
    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. Incorporate Loop Function In Recorded Macro
    By tarktran in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2015, 05:57 AM
  2. [SOLVED] Reduce code recorded from a macro in excel vba using a loop
    By VBA-Excel_Newbie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-24-2014, 05:00 AM
  3. Make recorded macro loop
    By cowannbell in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 01-11-2013, 09:53 AM
  4. How to create a loop for recorded macro?
    By Partisano in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-30-2012, 12:03 PM
  5. [SOLVED] Convert text file to CSV and extract data loop macro help
    By Savan87 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-23-2012, 04:42 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