Excelのセルの値を変数で書きたい

お世話になっております。

結果を書き込むエクセルファイルの最終行をとってきて、その下の行のA列からD列に1行追加したいのですが、どのように書いたらよいのでしょうか?

現状は
Excel.Sheet(“結果”).Range(“A”+(i_最終行+1).tostring:“D”+(i_最終行+1).tostring)

と書いているのですが、エラーとなります。

よろしくお願いいたします。

@rkym123456

What is the error you are getting?

こんにちは

式自体の静的エラーは以下で解消すると思います。

Excel.Sheet("結果").Range("A"+(i_最終行+1).tostring+":D"+(i_最終行+1).tostring)

やりたいことと合致していないときはその旨記載ください。

HI @rkym123456

How about this following?

Excel.Sheet("結果").Range("A"+CInt(i_最終行+1).tostring+":D"+CInt(i_最終行+1).tostring)

Regards
Gokul

みなさま、ありがとうございました。

望み通りの結果を得ることができました。助かりました。

Great @rkym123456

Kindly close this topic by mark as solution that your got solved for the following post by the users.

It will help for other too.

Regards
Gokul