列の幅を変更
Sub 列の幅()
ActiveSheet.Columns(1).ColumnWidth = 3
End Sub
Sub 列の幅()
ActiveSheet.Columns(1).ColumnWidth = 3
End Sub
Sub 名前をつけて保存()
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & ":test.xls"
End Sub
Win
Sub 名前をつけて保存()
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\test.xls"
End Sub
Sub A1を含む表に処理をする()
Dim i, rowCount As Integer
rowCount = ActiveSheet.Range("A1").CurrentRegion.Rows.Count
For i = 1 To rowCount
ActiveSheet.Range("A1").CurrentRegion.Rows(i).Value = i
Next
End Sub
Application.WorksheetFunction.Round(Cells(1, 2).Value, ●)切り上げ
Application.WorksheetFunction.RoundUP(Cells(1, 2).Value, ●)切り捨て
Application.WorksheetFunction.RoundDown(Cells(1, 2).Value, ●)
Sub 四捨五入()
Cells(1, 1).Value = Application.WorksheetFunction.Round(Cells(1, 2).Value, 3)
End Sub
Rows(L).Insert Shift:=xlDown
N = FreeFile Open "Macintosh HD:excel:" + "売価.txt" For Output As #N Print #N, baika Close #N
Cells(N, 2).NumberFormatLocal = "@"
Sub セルが数値なら()
If IsNumeric(Cells(3, 1).Value) = True Then
Cells(3, 1).Interior.ColorIndex = 6
End If
End Sub
Sub セルが空なら()
If IsEmpty(Cells(2, 1).Value) = True Then
Cells(2, 1).Interior.ColorIndex = 6
End If
End Sub
motoSheet = ActiveSheet.Name
Sheets.Add
ActiveSheet.Name = "step2"
For C = 1 To 45
Sheets("step2").Cells(C).ColumnWidth = Sheets(motoSheet).Cells(C).ColumnWidth
Sheets("step2").Cells(C).NumberFormatLocal = Sheets(motoSheet).Cells(C).NumberFormatLocal
Sheets("step2").Cells(C).VerticalAlignment = Sheets(motoSheet).Cells(C).VerticalAlignment
Next