Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the information in formula bar? 1

Status
Not open for further replies.

horoscope

Technical User
Dec 1, 2002
17
CN
A B C D E
1 2 3 4 10 (=SUM(A1:D1))
the upper it is a worksheet. in E1 is result of SUM(A1:D1).
in the formular bar of E1 ,i can see "(=SUM(A1:D1)".
my question is how can i get it in vb.
in below code e2 is just the result of function. what i need the formular expression , how can i get it.
Private Sub Workbook_Open()
Dim e2 As String
e2 = Application.Sheets("Sheet1").Cells(1, 5)
MsgBox e2
End Sub
 
Very simple. Just look into the Formula property of the Range object.
___
[tt]
Private Sub Workbook_Open()
Dim e2 As String
e2 = Application.Sheets("Sheet1").Cells(1, 5)[tt].Formula[/tt]
MsgBox e2
End Sub[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top