Results 1 to 5 of 5

Can someone please review my Macro and fix the issue of copy/paste data from 2 sheets

Threaded View

  1. #1
    Registered User
    Join Date
    02-12-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Can someone please review my Macro and fix the issue of copy/paste data from 2 sheets

    Hello All, Happy New Year!

    I was wondering if a more experienced VBA/Macro can help assist me in fixing a macro that I recorded. Basically the issue is I am transferring data columns from one sheet to another. Data on sheet "POPO" will be copied and pasted to sheet "DATA_INPUT. I will be taking columns A, B, C, D, E, and H, will paste them into the new sheet. The issue I am running into is, many times the original sheet data will be missing values in certain cells, specifically column B in original tab only transferring over small of data to the new tab (column D). I believe this is due to the missing values in cells which causes the copying and pasting to stop at the missing cell.

    if anyone asks, this is a repetitive report that I manually process 10-15 a day. I am hoping that macro can automate this process so I can concentrate on other reports. The original data size will vary.

    Original sheet: POPO
    New Sheet: DATA_INPUT



    Macro



    Sub POPO2()
    '
    ' POPO2Macro
    '
    
    '
        Cells.Select
        Selection.AutoFilter
        Application.Width = 1074.6
        Application.Height = 610.2
        Range("H5").Select
        ActiveSheet.Range("$A$1:$H$3383").AutoFilter Field:=7, Criteria1:="'0-0"
        ActiveWindow.ScrollColumn = 2
        Range("H110").Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.Copy
        Sheets("DATA_INPUT").Select
        Range("B2").Select
        ActiveSheet.Paste
        Sheets("POPO").Select
        ActiveWindow.ScrollColumn = 2
        ActiveWindow.ScrollColumn = 1
        Range("A110:A3443").Select
        Range(Selection, Selection.End(xlDown)).Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("DATA_INPUT").Select
        Range("A2").Select
        ActiveSheet.Paste
        Application.CutCopyMode = False
        Selection.Cut
        Range("C2").Select
        ActiveSheet.Paste
        Sheets("POPO").Select
        Range("B110").Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.Copy
        Sheets("DATA_INPUT").Select
        Range("D2").Select
        ActiveSheet.Paste
        Sheets("POPO").Select
        Range("C110:E147").Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlDown)).Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("DATA_INPUT").Select
        Range("E2").Select
        ActiveSheet.Paste
        Cells.Select
        Application.CutCopyMode = False
        Selection.AutoFilter
        ActiveSheet.Range("$A$1:$G$1045366").AutoFilter Field:=2, Criteria1:=Array( _
            "N.N", "N.N.", "NN", "NN NN NN", "NNN"), Operator:=xlFilterValues
        Rows("2:1045386").Select
        Selection.Delete Shift:=xlUp
        Selection.AutoFilter
        Range("B14").Select
        ActiveWindow.SmallScroll Down:=-33
    End Sub
    Last edited by MacroNewbie36; 01-19-2021 at 11:25 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Dynamic macro name / Concatenating macro name / Call a string variable as a macro name
    By vwhite in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-18-2020, 03:36 AM
  2. [SOLVED] macro showing error ( macro not found ) while trying to execute macro every 1 minute
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2018, 07:58 PM
  3. [SOLVED] Define variable in macro than calling that macro inside another macro
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2015, 10:58 AM
  4. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  5. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  6. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  7. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 AM

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