+ Reply to Thread
Results 1 to 5 of 5

Macro to transfer data as values to another sheet based on the result from a formula

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    Macro to transfer data as values to another sheet based on the result from a formula

    Hi,

    I found a macro (created by ky095n) in one forum that I tweaked so I can use it to transfer data from one sheet to another sheet (named: Closed) then delete that data in main sheet.
    My problem is that I want the transferred data as values (no formulas).
    Also, right now the code works fine if I type the text "Closed" but if the text is a result of a formula, the code doesn't work.
    I am new in excel.
    Hope I was able to explain my problem.
    Thanks in advance.

    Please Login or Register  to view this content.
    Last edited by bpiroma; 09-19-2012 at 07:22 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Macro to transfer data as values to another sheet based on the result from a formula

    For copying values, not formulas, I did a copy-paste special with the macro recorder and then edited the code generated to remove the Select and Selection parts. The macro recorder is the best way to generate code if you are not sure of the syntax or Excel object names.

    In which column is the text "Closed" the result of a formula? In the following code I've assumed it is column A.
    Please Login or Register  to view this content.
    If it isn't column A, change the "A" in the line | If .Parent.Cells(.Row, "A").Text = "Closed" Then | to the appropriate column letter.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    09-07-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Macro to transfer data as values to another sheet based on the result from a formula

    Hi Chippy,

    Thanks for the reply.
    It is now working but how come when it paste starting on row10 then when I deleted the sample data and tried it again, it started pasting in row11?
    Is there something that I am doing wrong?
    Thanks.

  4. #4
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Macro to transfer data as values to another sheet based on the result from a formula

    It works for me. It always pastes to the first empty cell in column A on the Closed sheet (determined by looking in column A from A20 upwards). You can see which cell it will paste to by adding the following line before the PasteSpecial:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-07-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Macro to transfer data as values to another sheet based on the result from a formula

    Thanks Chippy..
    It working great now..

+ 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