Consulting

Results 1 to 7 of 7

Thread: Archiving Rows on Excel using VBA

  1. #1
    VBAX Newbie
    Joined
    May 2017
    Posts
    3
    Location

    Archiving Rows on Excel using VBA

    Hi,
    This is my first time posting so please be gentle!

    I have two sheets relating to invoices named Current and Paid.

    I'd like to do a few things

    1. When I enter data into the sheet named Current, it highlights the row to remind me it's to be paid.

    2. When I enter a date into the the Paid column of the worksheet (column 9):

    a) the highlight is removed
    b) the row is moved to the next available row in the worksheet named Paid and the blank row created in the worksheet named Current is deleted (data moved up).

    I can highlight and remove the highlight using conditional formatting using COUNTIF however am unsure of what to write to read a date (1/1/17) rather than text.

    Any assistance will be greatly appreciated.

    Many thanks,
    Corrina

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Corrina, you would be far better off to have just one table with all items. They are all invoices, they are just in a different state of not paid or paid, so splitting just adds unnecessary complexity to your spreadsheet.

    You can identify the paid because they will have a date. If you add filters to the columns, you can filter on anything, customer, amount, and of course, paid invoices.
    Last edited by Bob Phillips; 05-23-2017 at 08:30 AM.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I can highlight and remove the highlight using conditional formatting using COUNTIF however am unsure of what to write to read a date (1/1/17) rather than text.
    Make sure your column is formatted as date e.g. NumberFormat = "dd/mm/yyyy"
    Select the column and use DateValue in the formula.

    For more on Conditional Formatting, visit Contextures
    Attached Images Attached Images
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    VBAX Newbie
    Joined
    May 2017
    Posts
    3
    Location
    Thank you xld and mdmackillop will try it and see how I go

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Do let us know what you try and how it goes. Don't just accept whatever you get, there is always round 2 :-).
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Contributor
    Joined
    Jul 2011
    Location
    Manchester
    Posts
    142
    Location

    copy to another worksheet then delete

    Hi Corrina.

    I have a test workbook that some of the guys on here helped me with in the past that will move the rows to the appropriate worksheet once marked as paid - attached

    I've used it on several workbook at work and the code is simple to follow

    Hope it helps

    Mykal

    Move and delete.xlsm

  7. #7
    VBAX Newbie
    Joined
    May 2017
    Posts
    3
    Location
    Quote Originally Posted by mykal66 View Post
    Hi Corrina.

    I have a test workbook that some of the guys on here helped me with in the past that will move the rows to the appropriate worksheet once marked as paid - attached

    I've used it on several workbook at work and the code is simple to follow

    Hope it helps

    Mykal

    Move and delete.xlsm
    Wow mykal66 (66 is a good year by the way!)

    I've copied my data into the spreadsheet you attached and it works like a charm!!

    Many thanks
    Corrina

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •