+ Reply to Thread
Results 1 to 2 of 2

VBA Copy Paste Based on Cell Contents and Colour

  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    Worcester
    MS-Off Ver
    Microsoft 365
    Posts
    19

    VBA Copy Paste Based on Cell Contents and Colour

    I'm looking for some help to sort out a macro that will loop through the first column of a table and find any instances where the cell equals "Civils" and where the cell is not highlighted (i.e. colour is 0, 0, 0). I want to copy the cell next to it and paste the value only into the next blank cell in column C on Sheet 2. From the small sample attached, I would expect the contents of B9 and B13 (753 and 787) to be pasted into sheet 2.

    Any help greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Copy Paste Based on Cell Contents and Colour

    If you want to paste into next empty row in column A
    Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
    OR
    If you want to paste to range("A1")
    instead of Sheets("Sheet2").Range("A1").PasteSpecial Paste:=xlPasteValues

    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. [SOLVED] Cell colour based on plus or minus % contents
    By iantix in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-03-2017, 10:13 AM
  2. Fill cell colour based on another cells contents.
    By Jamesbil in forum Excel General
    Replies: 14
    Last Post: 04-25-2016, 03:41 PM
  3. Replies: 2
    Last Post: 02-06-2016, 10:19 AM
  4. Copy Cell Contents, Colour and Border
    By Cremorneguy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2014, 05:08 PM
  5. [SOLVED] Copy Paste Contents based on contents in designated cell
    By nickmessick1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2014, 01:23 PM
  6. [SOLVED] Macro to copy and paste based on cell contents
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-23-2012, 11:07 AM
  7. Replies: 3
    Last Post: 07-15-2010, 08:49 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