+ Reply to Thread
Results 1 to 5 of 5

To find the last row with data and copying each 34 rows in each new sheets

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    UAE
    MS-Off Ver
    Excel 2013
    Posts
    3

    Question To find the last row with data and copying each 34 rows in each new sheets

    I have some idea in the coding part in excel and i was not able to get through to get the things out, could you please help me in doing this as its so urgent and i m stuck with my report generation:

    I have a sheet with filtered data with the following in the columns


    Column No Data in the column

    1 date

    2 project code

    3 vehicle

    4 time

    5 tons

    There can be chances that more columns can be added.

    I need to perform the following operations with the vba coding

    1.Find the total no of row with in the filtered data sheet (to make it easy take the first column- date for the referance)

    Based on the total row

    2.Find if the total row is less than 34 if so create one sheet with the excel sheet name taken from the column 1 (date) value of cell A2 and copy all the data of the entire rows (all the column)

    3.If the row is more than 34 rows then create each new sheet with 34 rows till all the (total rows) are copied


    eg: if the total rows with data is 80, create 3 sheets with sheet name format [23-01-2013 (1).xls] for the first sheet and copy rows up to 34, then copy rest 34 to another sheet name format [23-01-2013 (2).xls], and the last 12 to 3rd sheet with sheet name format [23-01-2013 (3).xls]

    Note: the excel sheet is to be created by using a template excel sheet which has the reporting format

    so to give an algorithm:

    find total rows t=?

    p=t

    if p<=34

    create new sheet taking the template with [date(1).xls] *date(1) is obtained from cell A2 copy the cells upto 34

    else

    if<=p

    create new templeate sheet [date(i).xls](*date(1) is obtained from cell A2)

    copy t-34 rows

    i=i+1

    t=t-34

    loop and copy till all the rows are copied with respective of 34 rows into each new sheets representing the template format.

    Can any body help me out with the coding for the excel 2013, Please?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: To find the last row with data and copying each 34 rows in each new sheets

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-05-2013
    Location
    UAE
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: To find the last row with data and copying each 34 rows in each new sheets

    hey AlphaFrog...well its creating the temple and not copying the data, i guess there's some issue with the code i have uploaded the excel sheet which has sheet 1 with rough data, and there is a button in sheet 1 which would pull out the data as required from the date, site and material given in the bold face and this data is copied to the sheet 2 from here when i press the button generate data the above mentioned operation should be performed ( copy the data from the sheet to the formatted invoice template by creating new sheets) and when i press the clear button all the data in the sheet 2 and the generated invoice should be deleted (here the sheet 2 data gets cleared)..please check the attachment...

  4. #4
    Registered User
    Join Date
    08-05-2013
    Location
    UAE
    MS-Off Ver
    Excel 2013
    Posts
    3

    Arrow Re: To find the last row with data and copying each 34 rows in each new sheets

    Invoice Generation.xlsthis is the attachment excel sheet for this purpose
    Last edited by ashishdev; 08-17-2013 at 05:40 AM.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: To find the last row with data and copying each 34 rows in each new sheets

    Please Login or Register  to view this content.

+ 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. FRUSTRATED - Need Help Copying Rows to Other Sheets
    By ericaregister78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-04-2013, 03:43 PM
  2. Replies: 17
    Last Post: 02-01-2013, 12:20 PM
  3. Clear previous sheets before copying rows
    By Fferjay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2011, 09:37 PM
  4. Comparing data between sheets, and copying rows with data
    By Fleone in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2006, 02:00 PM
  5. [SOLVED] Copying Different Rows from Different Sheets into one sheet
    By Toncat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2005, 10:55 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