回答受付が終了しました

VBAの質問です

補足

誤字ばかりで申し訳ございません…。

Visual Basic12閲覧

回答(1件)

1

一例です(´・ω・) Sub Sample() Dim i As Long, j As Long Dim sh1 As Worksheet, sh2 As Worksheet Dim rng As Range Set sh1 = Sheets("Sheet1") Set sh2 = Sheets("Sheet2") For i = 1 To sh2.Cells(Rows.Count, "A").End(xlUp).Row Set rng = sh2.Cells(i, "A") For j = 1 To Len(rng.Value) If IsNumeric(Mid(rng.Value, j, 1)) Then sh1.Cells(i, "A").Value = Val(Mid(rng.Value, j, Len(rng.Value))) Exit For End If Next j Next i End Sub

1人がナイス!しています