+ Reply to Thread
Results 1 to 4 of 4

Macro To Add New Worksheet

  1. #1
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479

    Macro To Add New Worksheet

    I have a spreadsheet with a worksheet for each month, so as a new month begins I add a new worksheet using a macro

    Each worksheet has 5 columns:

    A = Vendor, B = Date, C = Debits, D = Credits, E = Balance

    Row 30 contains the totals for columns C, D, & E, cell A30 contains the text Totals

    The macro I use is as follows


    VBA:
    Please Login or Register  to view this content.
    The problem I have is occaisionally extra rows are added so the totals may not be in row 30

    Is there any way that the macro can be changed so that it looks for the word Total in column A and then reads the contents of the corresponding cell E? to transfer that total to cell E2 on the next worksheet

    Also how can I make the clear cells part of the macro so that it clears cell down to the row immediately above the row with Totals in cell A?

    Thanks in advance for any help

    Paul
    Last edited by VBA Noob; 11-02-2008 at 04:50 PM.
    Paul

  2. #2
    Registered User
    Join Date
    11-04-2004
    Posts
    8
    I hesitate to reply as my VB is not the best, but there are no other replies..

    Try adding

    Please Login or Register  to view this content.

    and then paste into cell on the new sheet


    Hope this helps
    Willow
    Last edited by VBA Noob; 11-02-2008 at 04:51 PM.

  3. #3
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    without macro

    you should make a sample sheet in your workbook with all required columns and formating in it and total below with a reasonable number of empty rows between headers and Total.
    whenever you want to make new sheet for new month just click on that sample sheet, hold down Ctrl key and drag it to right or left side with mouse to make a copy and give proper name to it.

    Regards

  4. #4
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    I notice a few others have replied since I started looking at this. Anyway....

    I think you are saying that normally A30 contains Totals, but sometimes it is cell A31 or A32 etc. If I can assume that ONE cell in column A at or below A30, then the following code will find the cell for you.


    Please Login or Register  to view this content.
    Matt
    Last edited by VBA Noob; 11-02-2008 at 04:51 PM.

+ 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