if you want to use formula directly in vba with out putting your figures in any cell then do like this.
suppose you want minimum value of range cell "A1 To A10" in a variable
then write your code:-
With help this macro code you can mail easily from outlook in just a single click....
Sub Mail ()
ESubject = "Mail Subject"
SendTo = "email-id"
CCTo = "email-id"
'Ebody = "TEST MAIL"
Ebody = "Mail Body"
newfilename = " The complete Path of file that to mail"
Set App = CreateObject("Outlook.Application")
Set Itm = App.CreateItem(0)
With Itm
.Subject = ESubject
.To = SendTo
.CC = CCTo
.Body = Ebody
.Attachments.Add newfilename .send
End With
Set App = Nothing
Set Itm = Nothin
End Sub ()
Use this line to close your webpage or internet explorer that you opened through previous code
Type this...
ie.Quit
This for open
Sub VisitWebsite() Dim ie As Object Set ie =
CreateObject("INTERNETEXPLORER.APPLICATION") ie.NAVIGATE "http://excelmacrosnvba.blogspot.com" ie.Visible
= True While ie.busy DoEvents Wend End Sub
Here the code that can help you to easily open your website through VBA..
Sub VisitWebsite()
Dim ie As Object Set ie = CreateObject("INTERNETEXPLORER.APPLICATION") ie.NAVIGATE "http://excelmacrosnvba.blogspot.com" ie.Visible = True
While ie.busy DoEvents Wend
End Sub