+ Reply to Thread
Results 1 to 2 of 2

Automatically check for last date and insert row below the last date

  1. #1
    Registered User
    Join Date
    01-16-2014
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    68

    Automatically check for last date and insert row below the last date

    I have a sheet(Sample.xlsx) in which weekly data is collected and this is done by using the VBA code(Present in Copy 1 and Copy 2 button in Master US.xlsm) written by me. But in my code, it inserts a new after asking two parameters, i.e. line range(i.e. row no for eg A64) and date. I want it to automatically search row containing last date and inserts row below it and this needs to be implemented in "Insert Automatically" and "Insert Date" button using VBA code in Master US.xlsm sheet.I dont have problem with second paramenter.


    Logic i want to use :


    Itergation of whole page
    {
    If (col A<>Date)&& col A=Average(i.e. contains average word)
    then
    inserts row above that row
    And then ask for date to enter using date variable.


    then inserts row above that row containing last week data in col A.
    }

    "Insert Automatically" in Master US.xlsm sheet is the button which takes system date and implements the above logic.
    "Insert Date" in Master US.xlsm sheet is the button which ask for only date and implements the above logic.

    If any other method/ideas to solve this, then it is really appreciated.

    Sheets attached.

    Master US.xlsm Sample.xlsx

    Thanks in Advance. :-)

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Automatically check for last date and insert row below the last date

    Change your Set myRange section by this line of code and you're all set.
    It searches in column 1 for the first cell with data in it then it offsets 1 line below which must be an empty cell.
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

+ 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. Insert date automatically
    By TUNGANA KURMA RAJU in forum Excel General
    Replies: 1
    Last Post: 09-29-2005, 04:05 PM
  2. Automatically Hightlight Rows with w/Date Check?
    By Al Franz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2005, 10:05 PM
  3. Insert date automatically
    By MikeA in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2005, 06:05 PM
  4. Automatically Insert DATE, so that DATE will NOT change
    By Cie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-04-2005, 03:37 PM
  5. Insert date automatically
    By Rick in forum Excel General
    Replies: 2
    Last Post: 03-31-2005, 07:09 PM

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