+ Reply to Thread
Results 1 to 9 of 9

Automation of a spreadsheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    Automation of a spreadsheet

    Hi

    I've attached a sample sheet, of my data input - this is then analysed using pivot tables.

    There are a few automation processes that I would like to happen in the sheet - basically I want to input the least amount of information and allow excel to do the rest.

    Although the sample sheet doesn't show it I've already got Col A (QTR), Col C (DAY), Col D (MONTH), Col E (WK No) automated on input of date in Col B - thanks to daddylonglegs and vba Noob.

    For the rest I need help, so here goes:
    1. Col F (INC/EXP) - this will be manually input.
    2. Col G (Dept) - manually input
    3. Col H (Amt) - manually input
    4. Col I (category) - enter manually
    5. Col J (Type) - automatic by excel based on entry in Col I
    6. Col K (vat) - automatic by excel based on entry in Col J
    7. Col L (ref) - automatic by excel as the next sequential number (once the data in autofiltered by ascending date) i.e. PCV273 will be inputted manually first, then when the next cash exp in Col J appears (after the data is auto filtered by ascending date - Col B - excel will place PCV274 in the corresponding cell. Same goes for Chq numbers.

    So can someone have a look at this and see what they can come up with - I don't even know what functions to use!!

    Any help will be much appreciated.

    Regards

    Tony
    Last edited by VBA Noob; 01-31-2008 at 04:11 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    There's no example attached.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106

    ok let me try again

    Ok Roy

    I've attached it again - hopefully it will be there now.

    Regards

    Tony
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106
    Dear All Gurus

    I was just reading my original posting and thought that there might be some ambiguity.

    I wrote in point 7:
    Col L (ref) - automatic by excel as the next sequential number (once the data in autofiltered by ascending date) i.e. PCV273 will be inputted manually first, then when the next cash exp in Col J appears (after the data is auto filtered by ascending date - Col B - excel will place PCV274 in the corresponding cell. Same goes for Chq numbers.

    PCV273 is the first Petty Cash Voucher for the year, so basically I will input the first cheque number and PCV number of the year and then expect excel to start the sequence from there on.

    Just thought that I'd clarify it.

    Regards

    Tony

  5. #5
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106
    Dear All

    After lots of research, I've managed to sort out a lot of the issues as mentioned in my original posting.

    Unable to attach a sample file, as all are over the 100kb.

    There is a an outstanding issue and a new issue that I need your expertise on:

    Outstanding issue: automatic sequential numbering in col D (Ref) of the input sheet, after having autofiltered for ascending date - to apply to Cash Exp (Petty Cash Voucher - PCVxxx) and cheque exp - cheque number.

    New Issue: have offset/match formulae to the VLT sheet - one of the formula is

    =OFFSET(VLT!$B$1,MATCH(B2,VLT!$B$2:$B$57,0),-1)

    The problem I have is that VLT sheet has a dynamic range - fixed columns, but dynamic amount of rows - so how should the above formula, especially the figures in red be altered to cater for the dynamic number of rows?

    Thanks in advance to everyone that contributes to this.

    Tony

  6. #6
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    If you replace:
    VLT!$B$2:$B$57
    with:
    OFFSET(VLT!$B$2,0,0,COUNTA(VLT!B:B),1)
    you will get a dynamic expanding range.

    But I think in your case you could just use MATCH on the whole column like this:

    =OFFSET(VLT!$B$1,MATCH(B2,VLT!$B:$B,0),-1)

  7. #7
    Forum Contributor
    Join Date
    12-27-2007
    Posts
    106
    Hi Bjornar

    Just to inform you that I tried both method that you suggested but both returned a #N/A error.

    Regards

    Tony

  8. #8
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    #N/A is what the MATCH function return when no match is found.

    I see that you should add 1 to the MATCH result in my suggested formula, because your original lookup started in B2, and my formula started in B1 (the whole B column).

    =OFFSET(VLT!$B$1,MATCH(B2,VLT!$B:$B,0)+1,-1)

    But I don't think this is the source of your problem. Are you sure the value in B2 has a match in column B in sheet VLT ?

    One tip when you get an error in a nested formula like this is to step thru the formula calculation using Tools -> Formula Audition -> Evalute formula. The you will se in what part of the formula the error occurs.

+ 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