aシートのシート名:Sheet1
bシートのシート名:Sheet2
とします。
以下のマクロを標準モジュールに登録してください。
Sub test1()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim lastrow As Long
Dim row1 As Long
Dim row2 As Long
Set ws1 = Worksheets(\u0026quot;Sheet1\u0026quot;)
Set ws2 = Worksheets(\u0026quot;Sheet2\u0026quot;)
lastrow = ws1.Cells(Rows.Count, 1).End(xlUp).Row 'A列の最終行取得
ws2.Cells.ClearContents
row2 = 1
For row1 = 1 To lastrow
If (ws1.Cells(row1, 1).Value Mod 2) = 0 Then
ws2.Cells(row2, 1).Value = ws1.Cells(row1, 1).Value
row2 = row2 + 1
Else
ws2.Cells(row2, 1).Value = ws1.Cells(row1, 1).Value - 1
row2 = row2 + 1
ws2.Cells(row2, 1).Value = 1
row2 = row2 + 1
End If
Next
MsgBox (\u0026quot;完了\u0026quot;)
End Sub