Skip to content

Instantly share code, notes, and snippets.

View logic2design's full-sized avatar
🏠
Working from home

Logic2Design logic2design

🏠
Working from home
View GitHub Profile
Private Sub Command66_Click()
Const strParent = "\\prod.atonet.gov.au\atonetshares$\Individuals_Automation\Requests\Output\"
Dim olApp As Object
Dim objMail As Object
Dim strID As String
Dim strDate As String
Dim strOfficer As String
Dim strFolder As String
Dim strRisk As String
Global
"this function is used to simplify the sending of a webhook to integromat"
function callIntegromat(url : text, id : number) do
let data := {
RecordID: id
};
http("POST", url, {
'Content-Type': "application/json"
}, data)
tell application "Finder" to set shortName to name of (theFile as alias)
set theDialogText to "What is the Project name? - " & shortName
set theButtonIfPressedTheRuleWillContinue to "Next"
set theButtonIfPressedRuleAborts to "Skip"
set theDialogTitle to "Rename Folder"
tell application "System Events"
activate
set theResult to (display dialog theDialogText with title theDialogTitle default answer "" buttons {theButtonIfPressedTheRuleWillContinue, theButtonIfPressedRuleAborts} default button 1 giving up after 60)
tell application "Finder" to set shortName to name of (theFile as alias)
tell application "System Events"
activate
set theType to (choose from list {"Animation", "Articles", "Images", "SEO", "Videos", "Websites"} with prompt "Please select the Project type - " & shortName default items "" OK button name {"Next"} cancel button name {"Cancel"})
end tell
if theType contains "Animation" then
tell application "Finder"
duplicate files in folder "MacOS:Users:ijd65:Projects:Templates:Animation:" to theFile
@logic2design
logic2design / Form Window Name.vbs
Created January 25, 2020 08:10
Infopath set window name
function XDocument::OnSwitchView(eventObj)
{
XDocument.View.Window.Caption = "Name of Form";
}
@logic2design
logic2design / Update Pivot Table on Excel Change.vbs
Created August 29, 2020 10:11
Refreshes Pivot tables and Queries on Excel value change
‘Option 1: 2 Button Shapes per Tab | 2 Macros
Sub Display_Tab_Sales_RevenueQ
With ActiveSheet
‘Visibility of Tab Buttons
.Shapes("Tab_Button_Sales_Revenue_Inactive").Visible = False
.Shapes("Tab_Button_Sales_Revenue_Active").Visible = True
.Shapes("Tab_Button_Sales_Units_Inactive").Visible = True
.Shapes("Tab_Button_Sales_Units_Active").Visible = False
@logic2design
logic2design / Rename Subject.vbs
Last active August 29, 2020 10:27
Renames the subject of the selected Outlook email https://gist.github.com/38ab8c49bc1a54a1648e4cb76db25fd3
Private Sub Rename()
'Dim olTask As Outlook.TaskItem
'Using object so all items can be processed
Dim olitem As Object
Dim olExp As Outlook.Explorer
Dim fldCurrent As Outlook.MAPIFolder
Dim olApp As Outlook.Application
@logic2design
logic2design / Copy Range.vbs
Created August 29, 2020 10:28
Copy a specified range from multiple worksheets into a master worksheet
'Fill in the range that you want to copy
'Set CopyRng = sh.Range("A1:G1")
Sub CopyRangeFromMultiWorksheets()
Dim sh As Worksheet
Dim DestSh As Worksheet
Dim Last As Long
Dim CopyRng As Range
With Application
@logic2design
logic2design / Delete Row based on conditions.vbs
Created August 29, 2020 10:29
Delete Row based on multiple criteria Change Sheet(1) to required Sheet
Sub DeleteRows()
Dim x As Long
With Sheets(1)
For x = .UsedRange.Rows.Count To 2 Step -1
If .Cells(x, 1) < 0.2 And .Cells(x, 2) > 0.3 And .Cells(x, 3) > 10 Then
.Rows(x).Delete
End If
Next
End With
End Sub
@logic2design
logic2design / Wipe Row if Text not found.vbs
Created August 29, 2020 10:29
This will wipe the row if specified text is not found in a particular column
Public Function GetLastRow(ByVal rngToCheck As Range) As Long
Dim rngLast As Range
Set rngLast = rngToCheck.Find(what:="*", searchorder:=xlByRows, searchdirection:=xlPrevious)
If rngLast Is Nothing Then
GetLastRow = rngToCheck.Row
Else
GetLastRow = rngLast.Row