+ Reply to Thread
Results 1 to 3 of 3

Adding A New Customer At the End of A List

Hybrid View

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Reading
    MS-Off Ver
    Excel 2007
    Posts
    1

    Adding A New Customer At the End of A List

    Hi All,
    I have an excel spreadsheet with a tab named "cadet database". I wish to have a macro named "AddCadet" which takes the name of a cadet from cell F6 on a tab named "Add Profile", finds the last row of data in "cadet database" with no data present, and adds the name of the cadet to this cell in column B.
    Many Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Adding A New Customer At the End of A List

    Hey,

    try this one:
    Sub AddCadet()
        Dim LastRow As Long
        With Sheets("cadet database").UsedRange
            LastRow = .Rows(.Rows.Count).Row
        End With
        Sheets("cadet database").Range("B" & LastRow + 1) = Sheets("Add Profile").Range("F6")
    End Sub
    Last edited by RHCPgergo; 11-29-2012 at 07:43 AM. Reason: screwed up last row

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,440

    Re: Adding A New Customer At the End of A List

    Sub AddCadet()
    Application.ScreenUpdating = False
    Range("F6").Copy _
        Sheets("cadet database").Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
    Application.ScreenUpdating = True
    End Sub

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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