+ Reply to Thread
Results 1 to 5 of 5

Clear values

Hybrid View

Guest Clear values 03-03-2005, 06:06 PM
Guest Re: Clear values 03-03-2005, 06:06 PM
Guest Re: Clear values 03-04-2005, 12:06 PM
Guest Re: Clear values 03-04-2005, 12:06 PM
Guest Re: Clear values 03-04-2005, 01:06 PM
  1. #1
    Rene'
    Guest

    Clear values

    Hi
    I would like to copy a range and paste it elswhere but only formulas ad
    formats, without pasting the values that were int he copied range. How would
    I do this?
    Thanks!
    Rene'

  2. #2
    Bob Phillips
    Guest

    Re: Clear values

    rng1.Copy
    rng2.Pastespecial Paste:= xlPasteFormulas
    rng2.Pastespecial Paste:= xlPasteFormats

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Rene'" <Rene'@discussions.microsoft.com> wrote in message
    news:34A05B25-3F4F-4F4D-9A86-D8D73B041A70@microsoft.com...
    > Hi
    > I would like to copy a range and paste it elswhere but only formulas ad
    > formats, without pasting the values that were int he copied range. How

    would
    > I do this?
    > Thanks!
    > Rene'




  3. #3
    Renee
    Guest

    Re: Clear values

    Thanks for the reply

    My code:
    Range("D1:D376").Select
    Selection.Copy
    Range("C1:C376").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

    This is copying cell contents over to the new range. Also I forgot to ask
    the original question of clearing values. If I select a range, can I clear
    only the values and not the formulas?
    THanks for your help!
    Renee
    "Bob Phillips" wrote:

    > rng1.Copy
    > rng2.Pastespecial Paste:= xlPasteFormulas
    > rng2.Pastespecial Paste:= xlPasteFormats
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Rene'" <Rene'@discussions.microsoft.com> wrote in message
    > news:34A05B25-3F4F-4F4D-9A86-D8D73B041A70@microsoft.com...
    > > Hi
    > > I would like to copy a range and paste it elswhere but only formulas ad
    > > formats, without pasting the values that were int he copied range. How

    > would
    > > I do this?
    > > Thanks!
    > > Rene'

    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Clear values

    Simplify to

    Range("D1:D376").Copy
    With Range("C1:C376").
    .PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    .PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    .PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    End With

    To clear just values, not formulas, you have to test it

    Dim cell As Range

    For Each cell In Selection
    If Not cell.HasFormula Then
    cell.Value = ""
    End If
    Next cell


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Renee" <Renee@discussions.microsoft.com> wrote in message
    news:EA78FD9D-D461-4B0E-865B-79B6FFD8DEE4@microsoft.com...
    > Thanks for the reply
    >
    > My code:
    > Range("D1:D376").Select
    > Selection.Copy
    > Range("C1:C376").Select
    > Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    > SkipBlanks:=False, Transpose:=False
    > Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
    > SkipBlanks:=False, Transpose:=False
    > Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
    > SkipBlanks:=False, Transpose:=False
    >
    > This is copying cell contents over to the new range. Also I forgot to ask
    > the original question of clearing values. If I select a range, can I

    clear
    > only the values and not the formulas?
    > THanks for your help!
    > Renee
    > "Bob Phillips" wrote:
    >
    > > rng1.Copy
    > > rng2.Pastespecial Paste:= xlPasteFormulas
    > > rng2.Pastespecial Paste:= xlPasteFormats
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Rene'" <Rene'@discussions.microsoft.com> wrote in message
    > > news:34A05B25-3F4F-4F4D-9A86-D8D73B041A70@microsoft.com...
    > > > Hi
    > > > I would like to copy a range and paste it elswhere but only formulas

    ad
    > > > formats, without pasting the values that were int he copied range.

    How
    > > would
    > > > I do this?
    > > > Thanks!
    > > > Rene'

    > >
    > >
    > >




  5. #5
    Renee
    Guest

    Re: Clear values

    Thanks Bob
    It still is copying the values. I just added the clear bit to it and its
    working.
    Thanks again!

    "Bob Phillips" wrote:

    > Simplify to
    >
    > Range("D1:D376").Copy
    > With Range("C1:C376").
    > .PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    > SkipBlanks:=False, Transpose:=False
    > .PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
    > SkipBlanks:=False, Transpose:=False
    > .PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
    > SkipBlanks:=False, Transpose:=False
    > End With
    >
    > To clear just values, not formulas, you have to test it
    >
    > Dim cell As Range
    >
    > For Each cell In Selection
    > If Not cell.HasFormula Then
    > cell.Value = ""
    > End If
    > Next cell
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Renee" <Renee@discussions.microsoft.com> wrote in message
    > news:EA78FD9D-D461-4B0E-865B-79B6FFD8DEE4@microsoft.com...
    > > Thanks for the reply
    > >
    > > My code:
    > > Range("D1:D376").Select
    > > Selection.Copy
    > > Range("C1:C376").Select
    > > Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    > > SkipBlanks:=False, Transpose:=False
    > > Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
    > > SkipBlanks:=False, Transpose:=False
    > > Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
    > > SkipBlanks:=False, Transpose:=False
    > >
    > > This is copying cell contents over to the new range. Also I forgot to ask
    > > the original question of clearing values. If I select a range, can I

    > clear
    > > only the values and not the formulas?
    > > THanks for your help!
    > > Renee
    > > "Bob Phillips" wrote:
    > >
    > > > rng1.Copy
    > > > rng2.Pastespecial Paste:= xlPasteFormulas
    > > > rng2.Pastespecial Paste:= xlPasteFormats
    > > >
    > > > --
    > > >
    > > > HTH
    > > >
    > > > RP
    > > > (remove nothere from the email address if mailing direct)
    > > >
    > > >
    > > > "Rene'" <Rene'@discussions.microsoft.com> wrote in message
    > > > news:34A05B25-3F4F-4F4D-9A86-D8D73B041A70@microsoft.com...
    > > > > Hi
    > > > > I would like to copy a range and paste it elswhere but only formulas

    > ad
    > > > > formats, without pasting the values that were int he copied range.

    > How
    > > > would
    > > > > I do this?
    > > > > Thanks!
    > > > > Rene'
    > > >
    > > >
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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