Set SerchArea = Worksheets("AAAシート").Range("銀行名対応表") '別名定義
res = Application.WorksheetFunction.VLookup(”bbb", SerchArea, 2, False)
Set SerchArea = Worksheets("AAAシート").Range("銀行名対応表") '別名定義
res = Application.WorksheetFunction.VLookup(”bbb", SerchArea, 2, False)
'--- メイン
Dim wk1, wk2 As Variant
strJson = LoadJsonFromDB("12345")
wk2 = Split(wk1(1), "")
debug.print "12345" & wk2(0)
'--- JSON取得
Dim XMLhttp As Object
Dim myUrl As String
myUrl = "http://aaa.co.jp/bbb?code=" & pCode
Set XMLhttp = CreateObject("MSXML2.ServerXMLHTTP")
XMLhttp.Open "GET", myUrl, False
XMLhttp.setRequestHeader "Content-Type", "application/json"
XMLhttp.send
LoadJsonFromDB = XMLhttp.responseText
End Function
'--- 結果
procName = "IPアドレス取得"
Set accessLog = CreateObject("Scripting.Dictionary")
'--- IPアドレス
Set NetAdapters = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") _
.ExecQuery("Select * from Win32_NetworkAdapterConfiguration " & _
"Where (IPEnabled = TRUE)")
For Each objNic In NetAdapters 'ネットワークアダプターは、複数ある場合がある
For Each strIPAddress In objNic.IPAddress 'IPは、複数割り当てられている場合がある
resIP = strIPAddress
Exit For ' 1回のみ
Next
Exit For ' 1回のみ
Next
debug.print "IPアドレス=" & resIP
---結果---
IPアドレス=123.456.789.001
'-------------------------------------------------------------------------------
' 処理 :ショートカットキーセット
' 概要 :エクセル起動中のショートカットキーをセットする
' 書式 :
' ShortcutKey:="j" → "crl+j"で起動する
' Macro:="openForm" → 起動するマクロ( call openForm)
'-------------------------------------------------------------------------------
Sub setShortcutKey()
Application.MacroOptions Macro:="openForm", ShortcutKey:="j"
End Sub
'-------------------------------------------------------------------------------
' 処理 :オープンフォーム
' 概要 :コントロールフォームを開く
'-------------------------------------------------------------------------------
Sub openForm()
frm_Control.Show '--- コントロールフォームを開く
End Sub
'--- 宣言
Dim myUser As Object
Set myUser = CreateObject("Scripting.Dictionary")
'--- 作成
myUser.Add "名前", "ディック・ベイヤー"
myUser.Add "年齢", 87
'--- 使い方
msgbox "名前→" & myUser("名前") & " 年齢→" & myUser("名前")
'--- 全配列の取り出し
Dim strMsg As String
For Each var In myUser
debug.print var & ":" & myUser .Item(var) & vbCrLf
Next var
★結果
名前:ディック・ベイヤー
年齢:87