Results 1 to 10 of 10

Insert Row into the range under specific condition

Threaded View

Medex Insert Row into the range... 06-27-2018, 08:19 AM
Bernie Deitrick Re: Insert Row into the range... 06-27-2018, 10:33 AM
Medex Re: Insert Row into the range... 06-27-2018, 12:53 PM
Bernie Deitrick Re: Insert Row into the range... 06-27-2018, 12:59 PM
Medex Re: Insert Row into the range... 06-27-2018, 01:18 PM
Sintek Re: Insert Row into the range... 06-28-2018, 04:24 AM
Medex Re: Insert Row into the range... 06-30-2018, 04:20 AM
Sintek Re: Insert Row into the range... 06-30-2018, 05:14 AM
  1. #1
    Registered User
    Join Date
    06-27-2018
    Location
    Azerbaijan
    MS-Off Ver
    2013
    Posts
    29

    Insert Row into the range under specific condition

    Hello, Dear Members!

    I kindly ask you help me on this issue. Please find attached file.

    Here you will find Workers and their working years. I need to add new line for worker when his/her working year finished. For example when the date > 17.07.2018 I need to add new line for John. (date = today formula)

    It look like simple but this is a part of my vacation module.

    I started to write code like this and when I run it I got compile error for "MyTable". I can't find out issue.

    Sub AddWorkingYearLine()
    
    Dim WorVac As Worksheet:                Set WorVac = Worksheets("WorkerVacation")
    Dim i As Long
    Dim LRow As Long
    Dim LCol As Long
    Dim MyTable As Variant
    
    LRow = Range("A1048576").End(xlUp).Row: LCol = Range("XFD4").End(xlToLeft).Column
    
    MyTable = Range(Cells(4, 1), Cells(LRow, LCol))
    
    For i = 1 To UBound(MyTtable, 1)
    
    If Branches.Range("C" & i) > Range("D1") Then  'Range("D1") = today formula
    ......................
    
    End If
    Next i
    Attached Files Attached Files
    Last edited by Medex; 06-30-2018 at 04:09 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA to Insert Rows if Specific Condition is met.
    By DAN0127 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2016, 05:06 PM
  2. copying specific range from one workbook to another in specific range based on condition
    By ankitgoyalhsr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2015, 03:46 AM
  3. Need formula using 'If' condition & inserting a specific range.
    By andyzz in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-26-2014, 02:58 AM
  4. vba code to insert blank row after specific condition is met
    By archies.gall in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2014, 05:07 AM
  5. Macro to delete specific range in a row with condition
    By abareesh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2013, 10:12 AM
  6. Copy specific range when a condition is met
    By nikenis in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-04-2012, 02:25 AM
  7. Deleting Specific Range of Cells via Condition
    By Excel Newbie05 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-06-2008, 04:44 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