vba - Command button in Excel to make a copy of a row of data and move that row to a different tab in the same workbook -


i trying command button placed on worksheet in excel transfer line of data different sheet based on field in field. example have data in row has 6 different fields , 1 names type. have worksheets have same names type options. want happen user press , update button , type each row located , row placed in worksheet corresponds type. dont know if possible.

thanks in advance! bri

brianna!

try macro (copy , paste new module in vb editor), see if fits need; if it's good, create button, right-click it, "assign macro" select 'copyrow'.

>sub copyrow() > > >dim originalsheet string >dim typecolumn integer >dim startingline integer >dim mytype string > >originalsheet = activesheet.name > >'edit number match column "type" information >typecolumn = 1 >'edit part match starting point of records >startingline = 3 > >cells(startingline, typecolumn).select > >counter = 0 > >do while activecell.offset(counter, 0) <> "" > >    mytype = activecell.offset(counter, 0).value >    activecell.offset(counter, 0).entirerow.copy >    sheets(mytype).select >    range("a" & rows.count).end(xlup).offset(1).select >    selection.insert shift:=xldown >    sheets(originalsheet).select >    cells(startingline, typecolumn).select >    counter = counter + 1 > >loop > >'this exclude rows copied >'you can comment, alter or exclude line if wish >range(cells(startingline, typecolumn), cells(startingline + counter, >typecolumn)).entirerow.delete > >end sub 

hope helps!


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -