Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Coping Cell Values

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Arkansas
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm using the following in a macro script to copy the value of one cell to a new worksheet. Does anyone know how I can copy the value of the cell so that when the source cell has a formula it won't copy the formula, but will copy the value only?

    Sheets(CurrSheet).Range("A4").Copy Destination:=Sheets(NewSheet).Range("A4")

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Leiden, The Netherlands
    Posts
    68
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi boydr,

    try this
    Code:
    Sheets(CurrSheet).Range("A4").Copy 
    Sheets(NewSheet).Range("A4").PasteSpecial Paste:=xlValues
    Marc

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Also...

    Sheets("NewSheet").Range("A4").value = _
    Sheets("CurrSheet").Range("A4").value

    Tom

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Location
    Arkansas
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks for the help, but I can't get it to work. I know I'm leaving something out, but not sure what. This is what I tried:

    Sheets("NewSheet").Range("I4").Value Destination:=Sheets("CurrSheet").Range("B2").Value

  5. #5
    New Member
    Join Date
    Apr 2002
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Record a macro
    and select the cell
    then copy
    Then select the cell that you want to paste
    then paste special and have the options that paste just the value

    which this will do the same as paelinck code
    whihc should work


  6. #6
    Board Regular
    Join Date
    Apr 2002
    Location
    Arkansas
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Tried that too, but it didn't work. I pasted in this:

    Sheets(CurrSheet).Range("I6").Select
    Selection.Copy
    Sheets(NewSheet).Range("B6").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False

    But I get the error: "Select method of Range class failed" message.


    [ This Message was edited by: boydr on 2002-04-20 15:54 ]

  7. #7
    Board Regular
    Join Date
    Apr 2002
    Location
    Arkansas
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Actually, Tom, you're suggestion worked after I tried it again today. Not sure what I was doing yesterday, but thanks for your help and everyone elses.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •