+ Reply to Thread
Results 1 to 16 of 16

Copy a range skipping formulas when pasting

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Copy a range skipping formulas when pasting

    Hello everybody
    I have a range in sheet1 range("C9:K10") that have values only..
    I want to copy that range to sheet2 to the same range ("C9:K10") skipping the formulas in sheet2
    for example in cell E9 in sheet1 I have the value 25 , I need to skip that value during the paste process because the same cell in sheet2 has a formula
    Hope it is clear
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    Is there a way to skip the cells that have formulas from the paste process?

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    Is it possible to do such task or it is unfamiliar?!!

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    Is there a solution for that task?

  5. #5
    Registered User
    Join Date
    01-16-2014
    Location
    Algiers, Algeria
    MS-Off Ver
    Excel 2003, Excel 2013
    Posts
    33

    Re: Copy a range skipping formulas when pasting

    Hello There,
    You can try something like this:
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    But i suppose that the target cells should be mixture of xlCellTypeConstants and xlCellTypeBlanks
    How can I combine the two criteria in the your great code?

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

    Re: Copy a range skipping formulas when pasting

    I do not think this works in multiple selection of columns, but you can try

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    It doesn't work if I cleared the constants in sheet2 . I mean if they are blanks there is an error message which tells me there is no cells!

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

    Re: Copy a range skipping formulas when pasting

    How about this

    Please Login or Register  to view this content.
    OR

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    ?
    Last edited by AB33; 02-07-2015 at 06:30 PM.

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    Mr. AB33
    The same error message 1004 : No cells were found !!!

    I devised this little trick
    Please Login or Register  to view this content.
    Any suggestion about this trick?
    Last edited by YasserKhalil; 02-08-2015 at 05:41 AM.

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

    Re: Copy a range skipping formulas when pasting

    I did not get an error on

    Please Login or Register  to view this content.
    I do not think 2, and 4 work on multi column selection. Special cells works on a single column ONLY

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    Mr. AB33
    Thanks for your interest about this thread
    Try to clear the contents of the constants of Sheet2 and run the maco.
    The error message will appear

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

    Re: Copy a range skipping formulas when pasting

    Well as I said on earlier post, special cells does not work with multiple columns. It works with the loop as it is looking through each column (cell in a column) at a time.
    Try to select multiple columns with special cells and you will get an error saying that "You can not select multiple"

  14. #14
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    Thanks for the information Mr. AB33
    How can we overcome this error and get the correct results?

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

    Re: Copy a range skipping formulas when pasting

    I do not see any other than to loop through each cell.
    I do not like to include a line as error trapping, but on column with some cells which are not blank, you can probably put it as resume next if there are no blank cells, the code skips that cell.

  16. #16
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Copy a range skipping formulas when pasting

    Thas a lot for your help

+ 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] Copy Formulas from Set of Columns and Pasting into a Dynamic Range
    By Mr. Ice in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2014, 08:07 AM
  2. Skipping a cell when pasting
    By cobydobbs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-17-2013, 11:11 PM
  3. [SOLVED] Excel 2007 : Is there an easy way of copy/pasting formulas
    By lizsantiago07 in forum Excel General
    Replies: 5
    Last Post: 06-07-2012, 11:18 AM
  4. Copy and Pasting formulas in different Worksheets
    By JasonCrow in forum Excel General
    Replies: 1
    Last Post: 01-20-2012, 01:19 AM
  5. copy and pasting formulas!!
    By shwiger in forum Excel General
    Replies: 2
    Last Post: 04-22-2007, 07:55 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