excel vba - With VBA how do i make the row above the "active row" in a table -


when insert row in table, inserts row above current row, fine. need able make row inserted active row. how that? structure of code is:

for each row in [table]   if [condition]     row.insert 'this inserts row above "current" row     'here want move row inserted     activesheet.cells(row.row, [table[col]].column) = 5 'arbitrary value   end if next row 

try offset (row_no, col_no)

'to go previous row use  activecell.offset(-1, 0).activate  'to got next row use  activecell.offset(1, 0).activate

you can try below code :)

sub test()  = activecell.row - 1  rows(a).activate  end sub

incorporated code

for each row in [table]    if [condition]      row.insert 'this inserts row above "current" row      'here want move row inserted      = activecell.row - 1      rows(a).activate    end if  next row


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -