Sub MR2ERtoExcelER()
MsgBox "※変換したい情報を全部選択しておく必要があります※"
Dim WB As Workbook
Set WB = ActiveWorkbook
Dim WS1 As Worksheet
Set WS1 = WB.ActiveSheet
'--------------------------------------------------------
'実行速度向上のため画面更新と自動計算を停止
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'-----------------------------------------------------------
'現在選択しているセルの取得
Dim intStartGyo As Integer: intStartGyo = Selection.Row
Dim intLastGyo As Integer: intLastGyo = Selection.Row + Selection.Rows.Count - 1
Dim intStartClm As Integer: intStartClm = Selection.Column
Dim intLastClm As Integer: intLastClm = Selection.Column + Selection.Columns.Count - 1
'※初期置
Dim Rng As Range
Set Rng = WS1.Cells(intStartGyo, intStartClm)
Dim lWidth As Long: lWidth = 150 'エンティティオブジェクトのサイズ
Dim lHeight As Long: lHeight = 14 'エンティティオブジェクトのサイズ
lLeft = Rng.Left + 350 '初期位置
Ltop = Rng.Top + 10 '初期位置
Dim TblCnt As Integer: TblCnt = 0
Dim TblTitle As String
Dim TblStartTop As Integer
Dim ECnt As Integer
Dim strShapes As String
Dim FlgKey As Boolean
For j = intStartGyo To intLastGyo
'テーブルカウント
If WS1.Cells(j, intStartClm).Text = "[Entity]" Then
TblCnt = TblCnt + 1
TblTitle = Replace(WS1.Cells(j + 1, intStartClm).Text, "PName=", "")
ECnt = 0
strShapes = ""
Ltop = WS1.Cells(j + 1, intStartClm).Top + 10
TblStartTop = Ltop
FlgKey = True
End If
'エンティティの作成---------------------------------------
If Left(WS1.Cells(j, intStartClm).Text, 6) = "Field=" Then
Dim myShape1 As Shape
Dim strText() As String
strText = Split(WS1.Cells(j, intStartClm).Text, ",")
'主キーからそうでなくなった場合、線を足す
If strText(4) = "" Then
If FlgKey = True Then
Dim SShape As Shape
Set SShape = WS1.Shapes.AddConnector(msoConnectorStraight, lLeft, Ltop, lLeft + lWidth, Ltop)
strShapes = strShapes & "," & SShape.Name
FlgKey = False
End If
End If
Dim oShape As Shape
Set oShape = WS1.Shapes.AddShape(msoShapeRectangle, lLeft, Ltop, lWidth, lHeight)
With oShape
.Fill.Visible = msoFalse
.Fill.Solid 'グラデーション等無し
.Line.Visible = msoFalse
.TextFrame.Characters.Font.Color = vbBlack
If strText(4) = "" Then
.TextFrame.Characters.Text = Replace(strText(1), """", "")
Else
.TextFrame.Characters.Text = "■" & Replace(strText(1), """", "")
End If
.TextFrame.Characters.Font.Size = 8
.TextFrame.HorizontalAlignment = xlHAlignLeft
End With
strShapes = strShapes & "," & oShape.Name
'追加位置を下へずらす
Ltop = Ltop + lHeight
ECnt = ECnt + 1
End If
'-------------------------------------------------------
'次が異なるテーブルor終了行---------------------------------
If Len(strShapes) > 0 Then
If WS1.Cells(j + 1, intStartClm).Text = "[Entity]" Or j + 1 = intLastGyo Then
Set oShape = WS1.Shapes.AddShape(msoShapeRectangle, lLeft, TblStartTop - 20, lWidth, 30 + ECnt * (lHeight + 1))
With oShape
.Fill.Visible = msoFalse
.Fill.Solid 'グラデーション等無し
.Line.Visible = msoTrue
.TextFrame.Characters.Font.Color = vbBlue
.TextFrame.Characters.Text = TblTitle
.TextFrame.Characters.Font.Size = 8
.TextFrame.HorizontalAlignment = xlHAlignLeft
End With
'strShapes(ECnt) = oShape.Name
'ActiveSheet.Shapes.Range(Array("""" & oShape.Name & """" & strShapes)).Select
strShapes = strShapes & "," & oShape.Name
Dim valShapes() As String
valShapes = Split(strShapes, ",")
'oShape.Select
'Selection.ShapeRange.Group.Select
WS1.Shapes.Range(valShapes).Group
'追加位置を右へずらす
'lLeft = lLeft + lWidth + 5
'追加位置を下へずらす
Ltop = Ltop + 30 + ECnt * (lHeight + 1) + 10
End If
End If
'------------------------------------------------------------
Next
'実行速度向上のため画面更新と自動計算を再開---------------
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
'-----------------------------------------------------------
End Sub
2015年6月3日水曜日
2012年7月13日金曜日
[その他]igoogleやgoogleリーダーの代わりのNetvibesで出来ること
igoogle→NetVibesから乗り換えメモ。
追記:googleリーダも終了になったのでさらに積むことに…。
追記:Myyahooも終了…そのうちichrome試します。
結論から言うと
「Web Page」ガジェットと「HTML」ガジェットを使いこなせばigoogleより便利に使えそう。
単純にRSSリーダとして使えばgoogleリーダーも兼用できるし。⇒◆RSS関係◆へ。
追記:googleリーダも終了になったのでさらに積むことに…。
追記:Myyahooも終了…そのうちichrome試します。
結論から言うと
「Web Page」ガジェットと「HTML」ガジェットを使いこなせばigoogleより便利に使えそう。
単純にRSSリーダとして使えばgoogleリーダーも兼用できるし。⇒◆RSS関係◆へ。
以下、出来たことと方法メモ。
2012年2月29日水曜日
[その他]Evernoteと同期する @PGM覚書 #おぼえがきITブログ
Bloggerで
新規投稿の際はevernoteに転送する設定、にして
ブログのタイトルを↑このようにすれば
(@以降がノートブック名、#以降がタグ名)
Evernoteにも転送OKみたい。
文字や絵のはりつけはどうだろう?
OKぽい。
修正の場合は、一度「下書きに戻す」→「投稿」すると、再び送られる。
ただし、もちろんevernote側は2件になっちゃうのでいかがなもんか…。
そしてもちろん削除はNG。
でも、結構使えるかな。
または、evernote→Bloggerも出来るみたいなのでこちらでもいいかも。
これも修正、削除はNGだろうけど。
http://blog.hackingisbelieving.org/2011/11/evernote-blogger_05.html
新規投稿の際はevernoteに転送する設定、にして
ブログのタイトルを↑このようにすれば
(@以降がノートブック名、#以降がタグ名)
Evernoteにも転送OKみたい。
文字や絵のはりつけはどうだろう?
OKぽい。
修正の場合は、一度「下書きに戻す」→「投稿」すると、再び送られる。
ただし、もちろんevernote側は2件になっちゃうのでいかがなもんか…。
そしてもちろん削除はNG。
でも、結構使えるかな。
または、evernote→Bloggerも出来るみたいなのでこちらでもいいかも。
これも修正、削除はNGだろうけど。
http://blog.hackingisbelieving.org/2011/11/evernote-blogger_05.html
登録:
投稿 (Atom)