Results 1 to 2 of 2

Trying to add more rows to a table based on existing data

Threaded View

  1. #1
    Registered User
    Join Date
    12-06-2012
    Location
    El Paso, TX
    MS-Off Ver
    Excel 2007
    Posts
    14

    Trying to add more rows to a table based on existing data

    I would like to be able to use this code to add more rows with these formulas to the bottom of the already existing data. I have been able to get things relative to the first cell, but I dont know how to make the first cell relative to the end of the previously entered data.

    Sub test()

    Sheets("Logbook").Select

    Range("n4").Select
    ActiveCell.FormulaR1C1 = _
    "=IF(ISBLANK(rc[-12]),"""",VLOOKUP(rc[-12],Tail_Make,2))"

    ' Cross Country look up
    ActiveCell.Offset(columnOffset:=5).Activate
    ActiveCell.FormulaR1C1 = _
    "=IF(ISNUMBER(RC[179]),IF(RC[179]>50,""Y"",""""),"""")"

    ActiveCell.Offset(columnOffset:=3).Activate
    ActiveCell.FormulaR1C1 = _
    "=IF(ISBLANK(RC[-15]),"""",ROUND(IF(RC[-15]>RC[-14],(23-HOUR(RC[-15]-RC[-14]))+(60-MINUTE(RC[-15]-RC[-14]))/60,HOUR(RC[-14]-RC[-15])+MINUTE(RC[-14]-RC[-15])/60),2))"

    Range("A4:v4").Select
    Selection.AutoFill Destination:=Range("A4:v51"), Type:=xlFillDefault
    End Sub
    Attached Files Attached Files

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