名前の定義を利用する | シートの保護を利用する |
Sub test() Dim s1 As String Dim r As String, r1 As String Dim i As Long s1 = "Sheet1!" r1 = s1 & "$A$1" r = s1 & "$A$66" For i = 3 To 31 r = r & "," & s1 & "$A$" & 65 * (i - 1) + 1 Next i r = r & "," & r1 Range("E5").Value = r End Sub |
Sub Macro2() ActiveWorkbook.Names.Add Name:="入力順3", RefersTo:= _ "=Sheet1!$A$66,Sheet1!$A$131,Sheet1!$A$196,Sheet1!$A$261,Sheet1!$A$326,Sheet1!$A$391,Sheet1!$A$456,Sheet1!$A$521,Sheet1!$A$586,Sheet1!$A$651,Sheet1!$A$716,Sheet1!$A$781,Sheet1!$A$846,Sheet1!$A$911,Sheet1!$A$976,Sheet1!$A$1041,Sheet1!$A$1106,Sheet1!$A$1171,Sheet1!$A$1236,Sheet1!$A$1301,Sheet1!$A$1366,Sheet1!$A$1431,Sheet1!$A$1496,Sheet1!$A$1561,Sheet1!$A$1626,Sheet1!$A$1691,Sheet1!$A$1756,Sheet1!$A$1821,Sheet1!$A$1886,Sheet1!$A$1951,Sheet1!$A$1" End Sub |