+ Reply to Thread
Results 1 to 5 of 5

Copy Cells to Clipboard if Contain Data

  1. #1
    Registered User
    Join Date
    02-10-2020
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    19

    Question Copy Cells to Clipboard if Contain Data

    Good Afternoon All

    So I'm very new to VBA but scripting macros is part of my new job role and I'm learning as I work - therefore I'm having to frankenstein a lot of my code together as I go and reevaluate it later on as I'm reviewing my work.

    The requirements for one project is to put together a file that can be uploaded to a website that will automate payments. I've coded the entire thing and I'm really happy with the outcome, I had to butcher a code into it to export to .txt file but I understood it as I was going through it so I'm happy.

    The problem is, previously I was able to use the following to copy Cell U6 down to the last used cell in Column U to the clipboard:

    Please Login or Register  to view this content.
    It worked perfectly until I got right to the end and had to cell map based on the data I was given, now I've had to put a IF statement into the cells in the U column and the VBA code is now picking up all the empty cells (even though it was "" in the FALSE section of the IF statement). There are 50 cells in the template but ideally I'd like this to run all the way down as far as required, but filling out those cells will pick them up in the end .txt file.

    Could someone talk me through any way of changing this code so that it only grabs cells in that column that actually have data in them?

    Thanks in advance!

    Many thanks in advance.
    Last edited by jeffreybrown; 03-17-2020 at 02:33 PM. Reason: Please use code tags!

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Copy Cells to Clipboard if Contain Data

    Possibly...
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-10-2020
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    19

    Re: Copy Cells to Clipboard if Contain Data

    dangelor,

    Thanks for the reply, unfortunately this retrieves the same results as the original code.
    Last edited by jeffreybrown; 03-17-2020 at 02:33 PM. Reason: Removed quote!

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Copy Cells to Clipboard if Contain Data

    Could you post your existing code?

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Copy Cells to Clipboard if Contain Data

    Hi ChristovJN,

    Please don't quote whole posts -- it's just clutter.*If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
    HTH
    Regards, Jeff

+ 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. Copy ONLY cells with data to Clipboard but NOT the formulas?
    By Belinea2010 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 11-16-2017, 03:49 PM
  2. Show data > copy data to clipboard > hide data... clipboard data is gone??
    By DaveSev in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2015, 10:16 AM
  3. Copy to clipboard without blank cells
    By cocacrave in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-29-2015, 04:02 PM
  4. Copy non-consecutive cells to clipboard
    By ukyank in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-25-2013, 02:18 AM
  5. Copy Range of Cells to Clipboard
    By Vladamir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2012, 10:17 AM
  6. Copy the sum of selected cells to the clipboard
    By odin205 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-23-2009, 03:29 AM
  7. Copy (removing blank cells) without clipboard
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-05-2006, 08:35 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