+ Reply to Thread
Results 1 to 2 of 2

Pasting a value not a formula in a macro

  1. #1
    Registered User
    Join Date
    02-01-2006
    Posts
    44

    Pasting a value not a formula in a macro

    Hi,

    I have a macro that copies data from one sheet to another, the active cells in the first spreadsheet are "overwritten" each time by the user (who then uses them for another action) and the macro keeps a record of these entries by copying them into another sheet that purely acts as a "list". The list sheet uses a "next blank row" methodology and functions well.

    My problem is that when the macro copies the data it appears to copy the formula relating to the date inputted by the user and not the value. This results in all records showing whatever date is CURRENTLY showing in the first sheet.....I want it to copy the value and then when the next user overwrites the first sheet, it doesnt change the second sheet.

    My code is

    Please Login or Register  to view this content.
    Thanks

  2. #2
    Andrew Taylor
    Guest

    Re: Pasting a value not a formula in a macro

    Use the macro equivalent of Edit/Paste Special/Values:

    Selection.PasteSpecial xlPasteValues



    Alec H wrote:
    > Hi,
    >
    > I have a macro that copies data from one sheet to another, the active
    > cells in the first spreadsheet are "overwritten" each time by the user
    > (who then uses them for another action) and the macro keeps a record of
    > these entries by copying them into another sheet that purely acts as a
    > "list". The list sheet uses a "next blank row" methodology and
    > functions well.
    >
    > My problem is that when the macro copies the data it appears to copy
    > the formula relating to the date inputted by the user and not the
    > value. This results in all records showing whatever date is CURRENTLY
    > showing in the first sheet.....I want it to copy the value and then
    > when the next user overwrites the first sheet, it doesnt change the
    > second sheet.
    >
    > My code is
    >
    >
    > Code:
    > --------------------
    >
    > ' Save filtered customers ids to diary
    >
    > Sheets("Formulas").Select
    > Range("P5:P60").Select
    > Selection.Copy
    > Sheets("Stage 1 - Visit diary").Select
    > Range("A65536").End(xlUp).Offset(1, 0).Select
    > ActiveSheet.Paste
    >
    > ' Save visit date to diary
    >
    > Sheets("Formulas").Select
    > Range("S5:S60").Select
    > Selection.Copy
    > Sheets("Stage 1 - Visit diary").Select
    > Range("K65536").End(xlUp).Offset(1, 0).Select
    > ActiveSheet.Paste
    >
    > --------------------
    >
    >
    > Thanks
    >
    >
    > --
    > Alec H
    > ------------------------------------------------------------------------
    > Alec H's Profile: http://www.excelforum.com/member.php...o&userid=31042
    > View this thread: http://www.excelforum.com/showthread...hreadid=515686



+ 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