Tuesday, March 29, 2011

Open and create a E-mail?

Sub Open_Create_E_Mail()

Dim wbBook As Workbook

Set wbBook = ThisWorkbook

wbBook.FollowHyperlink "mailto:"

End Sub

Activate IE Browser?

Sub Activate_IE()

Dim oIE As Object

Set oIE = CreateObject("InternetExplorer.Application")

With oIE

.Visible = True

.Navigate "http://www.xldennis.com"

End With

Set oIE = Nothing

End Sub

Open_Access

Sub Open_Access()

Dim oAccess As Object

Set oAccess = CreateObject("Access.Application")

With oAccess

.Visible = True

.UserControl = True

End With

End Sub

MS Outlook

Sub Open_OutLook()

Dim oOutlook As Object

Dim oNameSpace As Object

Dim oInbox As Object



Set oOutlook = CreateObject("Outlook.Application")

Set oNameSpace = oOutlook.GetNamespace("MAPI")

Set oInbox = oNameSpace.Folders(1)

Set oInbox = oInbox.Folders("Inbox")

oInbox.Display

End Sub

How to find the last row or column or cell on a worksheet?

How to find the last row with data on a worksheet:

On Error Resume NextMsgBox ActiveSheet.Cells.Find(What:="*", _ SearchDirection:=xlPrevious, _ SearchOrder:=xlByRows).Row
How to find the last column with data on a worksheet:

On Error Resume NextMsgBox ActiveSheet.Cells.Find(What:="*", _ SearchDirection:=xlPrevious, _ SearchOrder:=xlByColumns).Column
How to find the last cell with data on a worksheet:

On Error Resume NextdxLastCol= ActiveSheet.Cells.Find(What:="*", _ SearchDirection:=xlPrevious, _ SearchOrder:=xlByColumns).Column
dxLastRow= ActiveSheet.Cells.Find(What:="*", _ SearchDirection:=xlPrevious, _ SearchOrder:=xlByRows).Row
dxLastCell=cells(ldxLastRow,dxLastCol).address
', '