+ Reply to Thread
Results 1 to 2 of 2

Copy/Paste to Next Empty Row Overwriting Previous Row When Column A Is Empty

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Green Bay, WI
    MS-Off Ver
    MS Office 2010
    Posts
    1

    Angry Copy/Paste to Next Empty Row Overwriting Previous Row When Column A Is Empty

    Hi all,

    This is my first time posting here as I can usually figure things out in Excel, but I'm stumped...I just started writing macros because a project at work left me wondering "how could this be automated and done better?" This problem is as follows:

    I have a spreadsheet that I made that has a bunch of dependent lists in it (template for testers' test scenarios/data requests), however, not all of the columns are applicable or used by everybody. Column A applies to everybody but some may forget to make a selection from the list in it. Note: The following problem does not occur if column A is filled in. I have a macro assigned to a button that copies and pastes values to the next empty row. My problem is that if column A is not filled in and the tester clicks on the button, the first time they do this, the data that's in the row being copied will be pasted in the first empty row. If the button is clicked again without column A filled in, the previous row will be overwritten. I need the macro to check if there is data in the whole previous row as opposed to one cell. I know this is probably a simple fix, but any suggestions would be appreciated.

    The macro I'm using is as follows:

    Sub CopyPaste()
    Range("A2:W2").Copy
    With Cells(Range("A65536").End(xlUp).Row + 1, 1)
    .PasteSpecial xlPasteValues
    End With
    End Sub


    Thanks in advance,

    Grant

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy/Paste to Next Empty Row Overwriting Previous Row When Column A Is Empty

    Please use code tags with your code.
    Assuming you want to copy on the same sheet in column A

    Please Login or Register  to view this content.

+ 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