Author: Basse

Send sheet as .pdf

Sub button_click()   Dim DataSti As String Dim Filnavn As String Dim objFolders As Object Set objFolders = CreateObject(“WScript.Shell”).SpecialFolders Dim OutlookPrg As Object Dim OutlookMail As Object Set OutlookPrg = CreateObject(“Outlook.Application”) Set OutlookMail = OutlookPrg.CreateItem(0)   DataPath = objFolders(“desktop”) & Application.PathSeparator Filnavn = Worksheets(“Sheet1”).Range(“D5”).Text  & “.pdf”   ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=DataPath & Filnavn, _ Quality:=xlQualityStandard, Read More …

a small homemade formula

This formula i use in my work quite a lot. Please note, that if you want to call the function in VBA, then you have to have the function in a module and not in a regular sheet. It took me a while to figure that one out 🙂  when i got started. I receive Read More …

“automatic” running subs

I sometimes get annoyed that i have to manually update Pivot tables and the likes, therefore i hope these can help other people as well. If there is any i have forgotten please comment, i’m still a bit new in the VBA world.   Private sub Worksheet_Deactivate() ‘ what to do when you leave a Read More …