- Excel VBA 質問スレ Part34
490 :488[sage]:2014/09/01(月) 19:08:16.67 ID:y5S85mVs - >>486
>>488を 訂正します。 .Range("J1") は With .Range(.Cells(1,1), .Cells(lastRow,1)) に かかってしまうから ちょっとまずい ※不具合パターン With Sheets("Webクエリ") With .Range(.Cells(2,1), .Cells(lastRow,1)) Debug.Print .Range("J1").Address '<---これ $J$2になる End With End With ※外の Withを止めて下にした方がよいかも Set Ws = Sheets("Webクエリ") With Ws.Range(Ws.Cells(1, 1), Ws.Cells(lastRow, 1)) .Replace What:="万", Replacement:="0000" '円でデータ区切り .TextToColumns Destination:=Ws.Range("J1"), _ DataType:=xlDelimited, _ Other:=True, _ OtherChar:="円", _ FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), _ TrailingMinusNumbers:=True End With
|