Results 1 to 4 of 4

Thread: How to change cell formula to text in VBA

  1. #1
    Join Date
    May 2009
    Posts
    45

    How to change cell formula to text in VBA

    Hi friends,

    I have created many formulas and now i want all of my formula to get converted into text through VBA.I have heared that it's possible but don't know how to do it can anyone help me out with this issue.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to change cell formula to text in VBA

    Try to use the following code in VBA


    Code:
    Sub temp()
    Dim temp As String
    
    temp = Cells(2, 3).Formula
    Cells(3, 3).Value = " " & temp
    
    End Sub

  3. #3
    Join Date
    Dec 2007
    Posts
    93

    Re: How to change cell formula to text in VBA

    You can also use this code for converting text in VBA.


    Code:
    Sub change()
    On Error Resume Next
    With ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas)
        .Value = .Value
    End With
    End Sub

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to change cell formula to text in VBA

    You can also use the following code for getting the formula and appropriately transfer it any where.

    Code:
    Dim a
    a=Cells(2,3).Formula
    cells(3,3).Formula=a

Similar Threads

  1. How to change cell color in excel based on text input
    By Chini mao in forum Windows Software
    Replies: 2
    Last Post: 06-01-2012, 09:19 PM
  2. Formula output result to a different cell
    By McKenzie! in forum Windows Software
    Replies: 6
    Last Post: 15-07-2011, 10:39 AM
  3. Clear Content in cell without deleting formula
    By ARTHUR18 in forum Windows Software
    Replies: 3
    Last Post: 05-06-2009, 11:03 AM
  4. Auto-populate a MS Word table cell with text from a diff cell?
    By dreamrthts in forum Windows Software
    Replies: 5
    Last Post: 23-03-2009, 10:39 PM
  5. Text not visible in cell only in Formula Bar (excel 2003)
    By NavinS in forum MS Office Support
    Replies: 1
    Last Post: 14-02-2008, 03:32 AM

Tags for this Thread

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
  •  
Page generated in 1,713,555,956.61883 seconds with 16 queries