+ Reply to Thread
Results 1 to 3 of 3

Export to open .csv file a selected cell range conditioned on a true/false in same row

  1. #1
    Registered User
    Join Date
    08-12-2012
    Location
    Brisbane, Queensland, Australai
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    6

    Question Export to open .csv file a selected cell range conditioned on a true/false in same row

    Hi everybody! recently registered as I have found this board to be very useful for previous problems.

    I have a problem similar to some other posts but they don't quite fit the bill for what I am trying to achieve.

    I need a macro that will export a selected range of cells (cells display is result of formula) in a certain row provided a true statement is present in a particular column (cell is in the same row), it will then need to look for the next blank row in that .csv workbook as other data will be present and paste it in as a value.

    The true statement that it needs to look at is in column C however columns A & B also have true/false but should be ignored.

    so the logic would be thus.

    will have an open Workbook (File.xls) with sheet named "Form"
    will have an open .csv file named "Dump" with sheet of same name

    then actions need to be:

    On sheet "Form" If C11=true then copy N11:V11
    paste into open .csv file "Dump" from next blank row starting at column A row 2 as row 1 will have a header
    then continue through the range
    if C**=false or blank then do nothing & skip to next row (there could be blank cells instead of false interspersed through column C)
    continue on loop down C12 etc until C82 (C82 is the last entry in the form and it should stop looking down column C at this point)
    then end with a vb message box "Transfer complete"

    I have tried to nut this out but have failed at every attempt. If anyone could provide me with some help/pointers that would be great!.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Export to open .csv file a selected cell range conditioned on a true/false in same row

    Give this a try.

    Copy to standard module in the File.xls workbook.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    08-12-2012
    Location
    Brisbane, Queensland, Australai
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    6

    Re: Export to open .csv file a selected cell range conditioned on a true/false in same row

    Hi Tinbendr,

    Thank you so very much for the coding - got it to work a treat!

    This has saved me hours of copying and sorting

+ 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