Results 1 to 4 of 4

VBA - Paste-Special Formula for Cells with Values

This is a discussion on VBA - Paste-Special Formula for Cells with Values within the Excel Questions forums, part of the Question Forums category; I'm looking for some VBA code that will allow me to do the following: In a given worksheet, for each ...

  1. #1
    New Member
    Join Date
    Feb 2008
    Posts
    35

    Default VBA - Paste-Special Formula for Cells with Values

    I'm looking for some VBA code that will allow me to do the following:

    In a given worksheet, for each cell that has data in it (numbers or text), I want to paste-special the formula that is in the clipboard.

    Any suggestions?

  2. #2
    Board Regular
    Join Date
    Aug 2005
    Posts
    712

    Default Re: VBA - Paste-Special Formula for Cells with Values

    Quote Originally Posted by jacksparrow View Post
    I'm looking for some VBA code that will allow me to do the following:

    In a given worksheet, for each cell that has data in it (numbers or text), I want to paste-special the formula that is in the clipboard.

    Any suggestions?
    This will replace any constants with numbers or text in the worksheet:
    Code:
    Cells.SpecialCells(xlCellTypeConstants, 3).PasteSpecial Paste:=xlPasteFormulas

  3. #3
    New Member
    Join Date
    Feb 2008
    Posts
    35

    Default Re: VBA - Paste-Special Formula for Cells with Values

    Thanks, you just saved me hours of work!

  4. #4
    Board Regular
    Join Date
    Jan 2012
    Posts
    172

    Default Re: VBA - Paste-Special Formula for Cells with Values

    Quote Originally Posted by goldfish View Post
    This will replace any constants with numbers or text in the worksheet:
    Code:
    Cells.SpecialCells(xlCellTypeConstants, 3).PasteSpecial Paste:=xlPasteFormulas
    i need full code

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
  •  


DMCA.com