+ Reply to Thread
Results 1 to 6 of 6

Copy non blank cells in a range where there are certain values in another column

  1. #1
    Registered User
    Join Date
    02-28-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2003
    Posts
    25

    Copy non blank cells in a range where there are certain values in another column

    I have a piece of code that is copying all non blank values from a range in 'column b' in workbook 1 to 'column b' in workbook 2. This works fine.

    What i need to be able to do is check values in 'column a' of workbook 1 also. If there is a value "D" in 'column a' of workbook 1, then I dont want the corresponding value in column b of workbook a to be included in the range that I am copying.

    Can someone please help?


    Please Login or Register  to view this content.
    Last edited by Knocknaboula; 07-23-2013 at 07:14 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Copy non blank cells in a range where there are certain values in another column

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    02-28-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Copy non blank cells in a range where there are certain values in another column

    Thank you. I am really a novice at all this.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Copy non blank cells in a range where there are certain values in another column

    Try this code...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-28-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Copy non blank cells in a range where there are certain values in another column

    Thank you very much for your reply. The filter is working fine but it is not copying the data to the second workbook. There are no errors. The second workbook is protected aparted from column B. Is the code you provided copying data from colum A also as this may be a reason why ist is not working?

  6. #6
    Registered User
    Join Date
    02-28-2013
    Location
    Ireland
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Copy non blank cells in a range where there are certain values in another column

    I got it working. I just reselected the range that i needed before copying. Thank you very much for your solution. I really appreciate it.

    ThisWorkbook.Sheets("Final").Activate
    Application.CutCopyMode = False

    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)

Similar Threads

  1. Variable range SUM , base range on other column blank cells?
    By stevnb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2012, 10:55 AM
  2. [SOLVED] Copy data from a range of cells into a blank range based on common cell
    By vanmeterkj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-03-2012, 10:18 AM
  3. Copy Data Range Between Blank Cells in Column
    By rs235251 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-20-2011, 12:51 PM
  4. inserting a blank column and copy values
    By pani_hcu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2011, 02:00 PM
  5. Copy nonerror values from a column to new column, no blank cells in between
    By farmerdave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2009, 12:47 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