一括ハイパーリンク4
9/14 一括ハイパーリンク4
---------(link_M4.vba)-----------------------------------
Sub link_M4()
' 一括ハイパーリンク4 link_M4.vba
' indexM Macro a列のフルパス+ファイル名をリンク処理をする。
' マクロ記録日 : 2018/9/12 ユーザー名 :
'
Dim y, last1 As Integer
Dim hd1 As String
last1 = Worksheets("test2").Range("a1").End(xlDown).Row
For y = 1 To last1 Step 1
If Range(Cells(y, 1), Cells(y, 1)) = "" Then
hd1 = hd1
Else
hd1 = Range(Cells(y, 1), Cells(y, 1))
End If
ActiveSheet.Hyperlinks.Add Anchor:=Range(Cells(y, 1), Cells(y, 1)), Address:=hd1
Next
End Sub
---------(link_M4.vba)-----------------------------------
データを1行おきに
8/12 範囲指定したデータ群を1行おきにするマクロ。
「仕事が速くなるExcelマクロの便利ワザがマスターできる本」から
---------(データを1行おきに.vba)-----------------------------------
Sub OpenRow()
Dim StartRow As Integer, StarColumn As Integer
StartRow = Selection.Offset(0, 0).Row
StartColumn = Selection.Offset(0, 0).Column
For i = 0 To Selection.Count - 1
Cells(StartRow + 1 + i * 2, StartColumn).Insert Shift:=xlDown
Next
Cells(StartRow, StartColumn).Select
End Sub
---------(データを1行おきに.vba)-----------------------------------
実行前後のイメージ 左から右に

データ要素にラベル
1/22 サンプルコード(データ要素にラベルをつける)VBA
--------------(データ要素にラベル.vba)-----------------------------
Sub AttachLabelsToPoints()
'Dimension variables.
Dim Counter As Integer, ChartName As String, xVals As String
' Disable screen updating while the subroutine is run.
Application.ScreenUpdating = False
'Store the formula for the first series in "xVals".
xVals = ActiveChart.SeriesCollection(1).Formula
'Extract the range for the data from xVals.
xVals = Mid(xVals, InStr(InStr(xVals, ","), xVals, _
Mid(Left(xVals, InStr(xVals, "!") - 1), 9)))
xVals = Left(xVals, InStr(InStr(xVals, "!"), xVals, ",") - 1)
Do While Left(xVals, 1) = ","
xVals = Mid(xVals, 2)
Loop
'Attach a label to each data point in the chart.
For Counter = 1 To Range(xVals).Cells.Count
ActiveChart.SeriesCollection(1).Points(Counter).HasDataLabel = _
True
ActiveChart.SeriesCollection(1).Points(Counter).DataLabel.Text = _
Range(xVals).Cells(Counter, 1).Offset(0, -1).Value
Next Counter
End Sub
--------------(データ要素にラベル.vba)-----------------------------