+ Reply to Thread
Results 1 to 2 of 2

Copying Rows to clipboard from a range if they have values

Hybrid View

  1. #1
    Registered User
    Join Date
    02-04-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    5

    Copying Rows to clipboard from a range if they have values

    Hello Excel Forum,

    I have a constant range of cells ("A8:Q530") that are populated from another worksheet. I have a button that when clicked I would like to select and then copy the rows that aren't blank to the clipboard. The number of rows that get populated are different each time but remain within the range above. After scouting the web for a few hours I found this...

    Dim RangeSelect As Range
    
    Set RangeSelect = Range("A8:Q8")
        With RangeSelect
        Range(Selection, Selection.End(xlDown)).Select
        End With
    RangeSelect.Copy
    (All the cells in the range contain IF formulas that return Blank or with a value.)

    However this only appears to select the first row (A8:Q8). Any help would be very much appreciated as I've only been using VBA for a week now.

    Thanks,

    MikeDC
    Last edited by MikeDC85; 02-04-2014 at 08:37 AM.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Copying Rows to clipboard from a range if they have values

    If the cells contain formulas, using End(xldown) will select them all even if your syntax is fixed. You must loop - either through each cell or only through one column if there will always be data for one of the columns if there will be any data for that row?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

+ 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 a range from Wks A to a specific range in Wks B into subseq blank rows in Wks B
    By Tanner2004 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2013, 03:29 PM
  2. Insert rows and copying values if cells contain values
    By Waninio in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-12-2011, 07:20 PM
  3. Replies: 0
    Last Post: 02-22-2011, 01:56 PM
  4. Copying an image into the clipboard
    By Omri6 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2008, 03:32 AM
  5. [SOLVED] Copying more than 255 Characters to the Clipboard
    By biker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2006, 04:05 AM

Tags for this Thread

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