+ Reply to Thread
Results 1 to 8 of 8

Command to separate header

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2003
    Posts
    42

    Command to separate header

    I'll be honest! I don't know much about Excel, I'm trying to learn a few things. Someone a few years back helped me with this separator code, to separate the races and leave 2 blank spaces in between. I've tried to find this code to see if I could adjust it but I don't know even where it is.

    I've attaching two examples-

    1. The pic and zip file shows an Excel sheet with data. Notice on the left the column RN. This is the race number which runs 1 to 10 generally. Also notice the header on top ei..TK,RN,HORSE etc...

    The command button you'll also notice on the top right of the sheet. Ive loaded data in this sheet so as of right now you would press the command button. The code then would separate the RN 1,2,3 etc.. and put the top header on top of each separation and leave two blank spaces in-between.

    The program is set-up with data. Just press the command button to see how it works if you want.


    I need to make a change to this separation Between RN numbers-

    I need the first header with RN1 to be placed at LINE 5. Then have EXACT placement with each header at 20 line intervals, so...RN2 with the header on top would be at line 25, RN3 AT line 45, RN4 AT line 65, RN5 at line 85 etc...


    Thanks ahead of time with any help on this or a direction to get a handle on how to do this.

    Mitch
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by MitchS; 01-14-2011 at 06:10 PM.

  2. #2
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: Command to seperate header

    Hi MitchS, can you provide result sheet you need to get? Row 5 has data, do we delete it and place header instead? The rows below still have "1".

  3. #3
    Registered User
    Join Date
    01-10-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Command to separate header

    Ok, give me a minute to create a sheet that would look like the final result I'm looking for..

  4. #4
    Registered User
    Join Date
    01-10-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Command to separate header

    I've attached an example of how it should look when the code separates the headers. As you can see with the very first zip file that there is only one header with a bunch of data. This code separates the data and puts a header on top of each new race (RN). In this new example file attached is how it should look at least the placement of the headers. Disregard the color coding and other stuff on this sheet. Of course you may find this other code useful with other projects..

    As you can see, the first header is placed on column 5. All of the RN 1 data will be placed under this. The next header should be EXACTLY 20 more columns at line 25 and then all of the RN 2 data will be under that. The next header will be at column 45 ( every header is exactly 20 columns) and RN 3 data will be under that and so on. Next header at column 65 with the RN 4 data under that and do forth.

    That's how it should look.
    Mitch
    Attached Files Attached Files
    Last edited by MitchS; 01-13-2011 at 05:42 PM.

  5. #5
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: Command to separate header

    see attachment, run macro "separate"
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-10-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Command to separate header

    I downloaded the file. Opened it up. Everything looked the same. I clicked the command button as usual and I get the same result. Maybe I'm not running it right? What do you mean by run the macros separately?

  7. #7
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: Command to separate header

    macro can be run not only by button but from tools menu as well. If that's a problem for you I attached the code to the button, press the button

    PS. "Separate" that's the name of the macro
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-10-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Command to separate header

    Great! Thank you so much! That's exactly what I wanted.

    Thanks again,
    Mitch

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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