Luis Garcia
Luis Garcia

Reputation: 1391

Inserting a row and manipulating values for the row

I am inserting a new row dynamically to my sheet With Row.Insert. I'd like to add some values in column B to that row I just added as in cell(my_new_row, 2).Value = myvalue. How can I do that? Thanks!

Upvotes: 0

Views: 105

Answers (1)

d-stroyer
d-stroyer

Reputation: 2706

Would this do what you need ?

Sub AddRowToto()
    ' Optionnaly define here which row to select
    ActiveSheet.Rows("12:12").Select
    Selection.Insert Shift:=xlDown
    Selection.Cells(1, 2) = "toto"
End Sub

Upvotes: 1

Related Questions