+ Reply to Thread
Results 1 to 2 of 2

Adding rows Automatically in Excell

  1. #1
    Registered User
    Join Date
    05-18-2009
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Adding rows Automatically in Excell

    Is a way to add rows to one sheet that includes dat entered on another sheet or workbook.

    I have been using the following code (copied from someone else) as a macro that I have assigned to a button on my sheet;
    ub AddNewData()
    ' Dim 1Rows As Long
    'With Range("Database")
    ' 1Rows= .Rows.Count + 1
    ' Range("Input") .copy Destination:=.Cells(1Rows, 1)
    ' .Resize (1rows).Name = "Database"
    'End With
    'End Sub

    The problem is that this macro will run every time the button is hit which would allow multiple duplicate enteries.

    Is there a way to change the code so that it will not add the rows unless it is a unique record?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Adding rows Automatically in Excell

    Please take a few minutes to read the forum rules, then edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

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