Copy one sheet to another,without the values

  • Re: Copy one sheet to another,without the values


    You could try

    Code
    Range("A1:A10").Select 'Edit the range of cells to clear
    Selection.ClearContents
    'Put your copy code here



    This will clear the contents of the input cells leaving your valued cells untouched



    EDIT by Moderator: ClearContents will clear the cells of ALL contents - formulas and values

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

  • Re: Copy one sheet to another,without the values


    If you need to leave the formulas and formats only (this would also clear any cells with descriptive text labels):

    Code
    Sheet1.UsedRange.SpecialCells(xlCellTypeConstants).ClearContents
  • Re: Copy one sheet to another,without the values


    OK Barb-B that s right

    Code
    Sheet1.UsedRange.SpecialCells(xlCellTypeConstants).ClearContents


    but

    Code
    Selection.ClearContents


    all is cleared I d tried it!

  • Re: Copy one sheet to another,without the values


    laskachien,


    Please read the forum rules. Code tags are require for all VBA code. I've add them for you this time. Be sure to use them in future posts.
    How to use code tags:


    [noparse]

    Code
    your code here

    [/noparse]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!