+ Reply to Thread
Results 1 to 7 of 7

Copying data on If condition, and then pasting to another workbook

  1. #1
    Registered User
    Join Date
    07-25-2019
    Location
    Application(Earth).Country(USA)
    MS-Off Ver
    v14 32bit
    Posts
    16

    Copying data on If condition, and then pasting to another workbook

    Hi, I was wondering if someone knows what I am doing wrong with the below code. I want to copy the data from column 51 in the Activesheet on the condition that its value does not equal 0, then paste it into cell A1 a workbook called Listbook. I am getting the below error when executing the code:

    Run time error '9'
    Subscript out of range


    Please Login or Register  to view this content.
    Thanks for your kind consideration

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Copying data on If condition, and then pasting to another workbook

    Do you want to copy every cell in Column 51 that has a Value <> 0 and paste that into the first empty cell in Column A of the first sheet in a Workbook called "ListBook" that is open also?

  3. #3
    Registered User
    Join Date
    07-25-2019
    Location
    Application(Earth).Country(USA)
    MS-Off Ver
    v14 32bit
    Posts
    16

    Re: Copying data on If condition, and then pasting to another workbook

    Hi jolivanes. Yes, that's exactly it.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Copying data on If condition, and then pasting to another workbook

    Try this. Change references if and where required.
    Code assumes that you have headers (as you should have) in the first Row of both Sheets
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Copying data on If condition, and then pasting to another workbook

    Did the supplied suggestion Work?
    Let us know so I can "retire" the trial workbooks.
    Thanks

  6. #6
    Registered User
    Join Date
    07-25-2019
    Location
    Application(Earth).Country(USA)
    MS-Off Ver
    v14 32bit
    Posts
    16

    Re: Copying data on If condition, and then pasting to another workbook

    Hi yes, it works great. Thank you so much

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Copying data on If condition, and then pasting to another workbook

    Thanks for the update.
    It's always nice to hear that suggestions work
    Good Luck

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copying data from one workbook to another based on condition
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2013, 10:29 AM
  2. [SOLVED] Copying data from other workbooks and pasting into master workbook
    By jcook1100 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-15-2013, 08:03 AM
  3. VBA code for copying and pasting data range from external workbook(s)
    By Adsup01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2013, 02:07 PM
  4. Replies: 1
    Last Post: 11-21-2012, 11:23 AM
  5. Filtering in another workbook, copying filtered data and pasting in source workbook
    By saadtariq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2012, 12:55 PM
  6. Replies: 3
    Last Post: 05-09-2012, 07:43 PM
  7. Filtering, Copying and Pasting Data from one Workbook to Another...
    By mtt23 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2012, 12:42 AM
  8. Copying Specific Data from One Workbook and Pasting to Another
    By dgarant in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-06-2012, 09:17 PM

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