Closed Thread
Results 1 to 9 of 9

Need to Autoformat a Report and the code is not doing what I need it to do

  1. #1
    Registered User
    Join Date
    03-15-2018
    Location
    Canada
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    10

    Need to Autoformat a Report and the code is not doing what I need it to do

    Hello,

    I have posted on some forums and managed to accumulate the following code to format my report:
    Please Login or Register  to view this content.
    This code does half of what I need it to do, but to be honest, I don't really understand how it works. I have 2 static columns on the left hand side called "Employee" and "Badge" the columns after that are all of the employees leaves of absence. Each leave of absence consists of 5 cells of information in 5 separate columns. The current code takes each of those cells and pulls it into the left hand side beside the employee names (which is great). What I need it to do is pull all 5 cells from the first leave of absence "block" beside the employee name and then pull another row down for the second 5 cell "block" for their second leave of absence.

    Could someone help me manipulate this code? I can explain in more detail if needed but I cant really post the information here as it is sensitive.
    Last edited by Leith Ross; 03-15-2018 at 04:40 PM. Reason: Added Code Tags

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    Here's how you can desensitize the data.
    - Make a copy of your report.
    - remove all but several dozen rows of data.
    - For the first person, give a name Name 01 - drag this down for the rest of the data.
    - For the Badge number - give a name Badge 01 - ditto
    - Same for SSANs, Phone numbers, etc.

    Not only will this make the data anonymous, it will also make it easier to test.

    RandBetween can be used to generate numbers if that data are also sensitive - after you generate the numbers, copy and paste them back in as values only.

    Mock up enough of the final report so we can get the idea.

    Then post:

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    Can you attach an Excel file to illustrate your data and result.
    It seems that the code you are showing is not complete ...!
    - Battle without fear gives no glory - Just try

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    addmaster666, please take the time to review our rules. There aren't many, and they are all important.

    Please post a link to the other site where you have asked the same question.

    Your post does not comply with Rule 8 of our Forum Rules: Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you must provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (most other forums have the same rule).
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Registered User
    Join Date
    03-15-2018
    Location
    Canada
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    10

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    Thank you all for taking the time to respond. I apologize for not properly following the rules. It is telling me I have to post a few times before I can upload anything or post links. Unfortunately this is also preventing me from posting a link to the other thread I have created! I don't mind doing that, but I feel like I have nothing useful to add! Can someone please tell me the exact amount of posts I need to put up before I can upload? I have a copy of the example data but I guess I will have to wait before I can upload....

  6. #6
    Registered User
    Join Date
    03-15-2018
    Location
    Canada
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    10

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    Oddly enough that gave me enough posts to upload!

    Here is a link to the other thread. I have uploaded the example workbook as well.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-15-2018
    Location
    Canada
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    10

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    Quote Originally Posted by addmaster666 View Post
    Oddly enough that gave me enough posts to upload!

    Here is a link to the other thread. I have uploaded the example workbook as well.
    Apologies, the thread link didn't go through....it appears that I still do not have enough posts to attach the link?

    Also, my workbook has sheet one as an example of how the raw data pulls and sheet 2 as how I need it to look. Keep in mind that I pull this report every month so the code needs to be able to adjust to additional leaves of absence (which could technically be infinite. The max leaves one person has taken is 10 right now) and the amount of people added (which could also technically be infinite although I am currently working with 516 rows of people).

  8. #8
    Registered User
    Join Date
    03-15-2018
    Location
    Canada
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    10

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    I am just going to post the link like this so I am not breaking any rules www(DOT)mrexcel(DOT)com/forum/excel-questions/1047637-trying-create-macro-autoformat-report-post5030422(DOT)html

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Need to Autoformat a Report and the code is not doing what I need it to do

    Re-posted to Commercial Services. Thread closed.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Creating a VBA code for the report
    By Nxvle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2016, 08:10 AM
  2. Replies: 9
    Last Post: 04-17-2016, 07:34 PM
  3. Agging report, openingbalance report,customer report vab code was not working
    By rana19 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2015, 03:38 AM
  4. Replies: 4
    Last Post: 08-18-2015, 10:02 AM
  5. Summary Report Using VB code
    By lostinformulas in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-10-2007, 02:32 PM
  6. Replies: 1
    Last Post: 04-05-2006, 09:10 PM
  7. Report Code
    By Soniya in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2005, 05:25 AM

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