2024-03-07から1日間の記事一覧
Sub 最新単価抽出() Dim wsData As Worksheet Dim wsOutput As Worksheet Dim lastRow As Long Dim partNumCol As Long, dimCol As Long, bcCol As Long, dateCol As Long, priceCol As Long Dim key As Variant Dim priceDict As Object Dim maxDateDict As…
Sub ExtractLatestPrice() Dim ws As Worksheet Dim lastRow As Long Dim partNumbers As Variant Dim uniquePartNumbers As Variant Dim partNumber As Variant Dim i As Long Dim maxDate As Date Dim latestPrice As Double Dim outputRow As Long ' デー…
Sub ExtractLatestPrices4() Dim wsSource As Worksheet Dim wsTarget As Worksheet Dim lastRow As Long Dim partNumbers As Object Dim key As String Dim maxDate As Date Dim latestPrice As Double Dim newData() As Variant Dim i As Long Dim newRow …
Sub シート連番() Dim ws As Worksheet Dim i As Integer i = 1 For Each ws In ThisWorkbook.Sheets If Left(ws.Name, 2) = "最新" Then ws.Name = Left(ws.Name, 4) & Format(i, "00") i = i + 1 End If Next wsEnd Sub
Sub日付け変更 () Dim cell As Range Dim originalDate As String Dim convertedDate As String ' 変換したいセルの範囲を指定 For Each cell In Selection ' セルの値を取得 originalDate = cell.Value ' yyyymmdd形式からyyyy/mm/dd形式に変換 If Len(orig…