Skip to content

Instantly share code, notes, and snippets.

View hedgejanuary's full-sized avatar

hedgejanuary hedgejanuary

View GitHub Profile
@hedgejanuary
hedgejanuary / setTableBorders.bas
Created March 15, 2019 16:03
Setting table borders.
Sub settingTblBorders()
ActiveSheet.Cells.Clear
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
@hedgejanuary
hedgejanuary / setTableBorders.bas
Created March 15, 2019 16:03
Setting table borders.
Sub settingTblBorders()
ActiveSheet.Cells.Clear
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
@hedgejanuary
hedgejanuary / CreatingSheetIndex.bas
Last active December 3, 2023 13:27
Add a sheet and create a sheet list.
Sub CreatingTOCSheet()
Dim bkTarget As Workbook 'subject workbook
Dim shTOC As Worksheet 'TOC worksheet
Dim sh As Worksheet 'worksheets to be listed
Dim flag As Boolean 'boolean to check if a new worksheet is necessary
Dim finalRow As Integer
Dim i As Integer
Dim msgAnswer As VBA.VbMsgBoxResult 'store the answer of the message box
Dim shName As String
@hedgejanuary
hedgejanuary / ListLinks.bas
Created June 14, 2018 13:41
Check if the file has the external links and list them in the first sheet.
@hedgejanuary
hedgejanuary / GoogleCal_to_Email.js
Last active April 3, 2018 17:31
Google Calendarから今後7日間の予定を取得し、メールで送信する。
//今後7日間の予定をメールで送る。
function GoogleCalToEmail() {
var list = "";
var s;
s = listupEvent("XXXXXXXXXXXXXXXXX@group.calendar.google.com"); //Boss' schedule
if (s != "") list += " \n##■XXX's schedule \n" + s + " \n";
s = listupEvent("XXXXXXXXXXXXXXXXX@group.calendar.google.com"); //XXX Group's Events
@hedgejanuary
hedgejanuary / GoogleCal_to_MSTeams.js
Last active February 26, 2020 12:36
Google Calendar から今後7日間の予定を取得し、MS Teamsのスケジュール用チャンネルに投稿する。
//スケジュールアシスタントが今後7日間の予定を投稿してくれる
function GoogleCalToMSTeams() {
var list = '';
var calEvents = '';
var calendarInUse = [
// 使用するカレンダーのアドレスとそのラベリング
['xxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com', '\n##■XXX\'s schedule\n'],
['xxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com', '\n##■Out of office (staff)\n'],
['xxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com', '\n##■XXX events\n'],
['xxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com', '\n##■XXX Office events\n'],
@hedgejanuary
hedgejanuary / CleanUpData_3col.vb
Last active May 6, 2019 19:58
Cleaning up excel data (3 columns)
Option Explicit
Sub CleanUpData()
Dim i As Long
Dim LastRow As Long
'空白行を削除
Range("A:A").Cells.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
'データの最終行
@hedgejanuary
hedgejanuary / CleanUpData_2col.vb
Last active May 6, 2019 19:54
Cleaning up excel data (2 columns)
Option Explicit
Sub CleanUpData()
Dim i As Long
Dim LastRow As Long
'空白行を削除
Range("A:A").Cells.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
'データの最終行
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
@hedgejanuary
hedgejanuary / pushToCalendar.js
Last active February 4, 2018 23:42
Posting events from Google Spreadsheet to Google Calendar
/* カレンダーへイベントを登録する */
function pushToCalendar() {
//シートの項目を以下変数定義
var dSheet, Cal, i, Title, StartDate, StartTime, EndDate, EndTime, AllDayEvent, Description, Location, Status;
//dSheetを定義
dSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
//calendar variables
Cal = CalendarApp.getCalendarById("XXXXX.google.com"); //<---XXXXXを自分のgmailアドレスへ変更する
//シートの2行目〜最終行まで処理を繰り返す
for (i = 2; i <= dSheet.getLastRow(); i++) {