Results 1 to 4 of 4

copy data from one sheet to end of range on another

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-14-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    125

    copy data from one sheet to end of range on another

    It feels like this should be super simple but I have tried like 5 different things and it still won't work. It's likely I am just missing something completely obvious to try .
    I am trying to have dept. W jump from one worksheet to another in same workbook to copy/paste between them once it reviews the data it needs to that was previously placed there.
    Dept. W needs to copy a section from one sheet that is pushed from outlook by dept.X and has a default usage region of A2:O50 and just paste that list unto another worksheet that has a running list already started for the month that is controlled by dept Y.

    I want to use VBA via a pushbutton because there are dozen's of worksheet pages and the pages are password controlled so not everyone "sees" all the pages. Regardless if I do F8 and step through the code it works fine until it actually needs to paste all the potentially copied rows. If gives an error message instead of pasting data. Any suggestions appreciated. Thanks in advance!

    Sub ConvertData()
    'takes data + adds to "Worksheet1" running page
    Worksheets("Worksheet2").Activate
    Application.ScreenUpdating = True 'need to turn false back on once section coded in complete
    
    'Error message if no data there to upload
    If [A2] = "" Then
    MsgBox "Program ended: There is not currently any new data in file to upload."
        Exit Sub
        End If
    
      'define future range variable
       Dim rngLastRow As Range
       
       'Copy Reviewed data entered onto pg
       ActiveSheet.[A2:O50].Select
       Selection.Copy
       
       'switch to Monthly Data sheet and find first blank row
       Worksheets("Worksheet1").Activate
       If [H5] = "" Then ActiveSheet.[H5].Select
       If [H5] <> "" Then
       Set rngLastRow = ActiveSheet.[H5].End(xlDown).Offset(1, 0)
    '   rngLastRow.Select
       End If
       
       rngLstRow.Offset(1, 0).Paste
    Last edited by LiLi1; 02-20-2012 at 04:48 PM.

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