Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-05-2009
Members
 
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.
Reply With Quote
  #2  
Old 08-05-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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
Reply With Quote
  #3  
Old 08-05-2009
Member
 
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
Reply With Quote
  #4  
Old 08-05-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 11:29 AM.