ラブびあ

ビール。ときどきラブ

日時フォーマット関数

VBScriptの標準関数を使った日時のフォーマット関数 関数定義 function format(datetime, style) dim y,m,d,h,n,s,w y = Year(datetime) m = Month(datetime) d = Day(datetime) h = Hour(datetime) n = Minute(datetime) s = Second(datetime) w = Weekday(…

xml整形マクロ

xmlのようなタグ付けテキストを、インデントして見やすくする秀丸マクロ。簡易なのでキレイに整形できない場合もあるかも。 disabledraw; // 下準備 replaceallfast "\t", "" ,regular; replaceallfast "^ +", "" ,regular; replaceallfast "\n", "" ,regula…

richcopy.vbs

VBScript版 ' このスクリプトファイルを実行するには RichCopy.exe が必要です。 ' RichCopy.exe は下記のサイトからダウンロードすることができます。 ' ' UtilitySpotlight ' http://technet.microsoft.com/ja-jp/magazine/2009.04.utilityspotlight.aspx '…

robocopy.bat

バッチファイル版 @echo off rem このバッチファイルを実行するには robocopy.exe が必要です。 rem robocopy.exe は下記のリソースキットに同梱されています。 rem このリソースキットは WindowsXP SP1以降 で使用することができます。 rem Windows Server …

ローカルのフォルダを開く.vbs

Option Explicit dim wsh set wsh = CreateObject("WScript.Shell") dim fso set fso = CreateObject("Scripting.FileSystemObject") dim cfg cfg = fso.BuildPath( _ fso.GetParentFolderName(WScript.ScriptFullName), _ "サーバとローカルのパス.txt" ) E…

ローカルのファイルを開く.vbs

Option Explicit dim wsh set wsh = CreateObject("WScript.Shell") dim fso set fso = CreateObject("Scripting.FileSystemObject") dim cfg cfg = fso.BuildPath( _ fso.GetParentFolderName(WScript.ScriptFullName), _ "サーバとローカルのパス.txt" ) E…

ローカルで開く.vbs

Option Explicit dim wsh set wsh = CreateObject("WScript.Shell") dim fso set fso = CreateObject("Scripting.FileSystemObject") dim cfg cfg = fso.BuildPath( _ fso.GetParentFolderName(WScript.ScriptFullName), _ "サーバとローカルのパス.txt" ) E…

サーバのフォルダを開く.vbs

Option Explicit dim wsh set wsh = CreateObject("WScript.Shell") dim fso set fso = CreateObject("Scripting.FileSystemObject") dim cfg cfg = fso.BuildPath( _ fso.GetParentFolderName(WScript.ScriptFullName), _ "サーバとローカルのパス.txt" ) E…

サーバのファイルを開く.vbs

Option Explicit dim wsh set wsh = CreateObject("WScript.Shell") dim fso set fso = CreateObject("Scripting.FileSystemObject") dim cfg cfg = fso.BuildPath( _ fso.GetParentFolderName(WScript.ScriptFullName), _ "サーバとローカルのパス.txt" ) E…

サーバとローカルのパス.txt

const lroot = "C:\temp\" const sroot = "\\server\hoge\fuga\" const vbNormalFocus = 1

サーバとローカルで同期的に開く

「サーバとローカルのパス.txt」にルートとなるパスを設定し、send toへvbsのショートカットを作成して使います。一番使いそうなのは「ローカルで開く.vbs」エクスプローラでサーバのフォルダを開いて \\server\hoge\fuga\piyo\puyo\poyo.xls を右クリック->…

類似文字列判定

' Similar(refs as 検索範囲, ref as 検索対象, deg as 類似度) Function Similar(refs As Range, ref As Range, deg As Long) As Boolean Dim r As Range For Each r In refs If (r.Address <> ref.Address) And (Len(r.Value) > 0) Then If SimilarStrings…

式を値で表示

Function 式(c As Range) As String Dim s As String, a As String, i As Long, j As Long, r As Range s = c.Formula For i = 2 To Len(c.Formula) 'i:Midの開始位置 1文字目の「=」は飛ばす For j = Len(c.Formula) - i + 1 To 1 Step -1 'j:Midの文字数 a…

dzip

ICSharpCode.SharpZipLib.dll Imports System.IO Imports ICSharpCode.SharpZipLib.Zip Module Main Sub Main(ByVal args() As String) If args.Length = 0 Then Console.WriteLine("dzip.exe [-debug] [source directory]") Console.WriteLine(" dzip.exe m…

xmlMail

Imports System.IO Imports System.Xml Imports System.Net.Mail Imports System.Xml.Serialization Module Main Dim smtp As New SmtpClient Function getText(ByRef node As XmlNode, ByRef def As String) As String If node Is Nothing OrElse node.Inne…

Node.cls

VERSION 1.0 CLASS BEGIN MultiUse = -1 ' True END Attribute VB_Name = "Node" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Option Explicit Dim m_Name As S…

Export

Sub Export(ws As Worksheet) Dim f As Variant f = Application.GetSaveAsFilename(ws.Name & ".txt", "テキストファイル (*.txt), *.txt") If f = False Then Exit Sub Open f For Output As #1 Const topx = 2 Const topy = 5 Dim endx As Long Dim endy …

summary.vbs

Option Explicit 'On Error Resume Next ' ---------------------------------------------------------------------- ' テキストファイルを入れたフォルダをドロップすると、 ' フォルダ内のファイルを一つのExcelブックに読み込みます ' -----------------…