excel - Reference copied data to original cells -
i trying reference copied data, initial cell. sequence follows
- add newsheet on button click // sheetname load1, load2, etc
- input data new sheet
- click add new load.
- copy specific cells
- paste in summary sheet
6. link pasted values original worksheet cells???
my code
sub new_load() dim integer dim ws worksheet dim sh worksheet dim x1, x2, x3, x4, x5, x6, x7, x8 variant ' motor loads dim y1, y2, y3, y4, y5 variant 'ups loads ' y5 (cell c14 white text) sheetname set ws = sheets("tech_form") ' set sh = sheets(sheets.count) ' last sheet in workbook application.screenupdating = 0 if range("d15") = "ups" fill_blanks 'fill blanks n/a y1 = range("d15").value y2 = range("e42").value y3 = range("h42").value y4 = range("e46").value y5 = range("c15").value sheets("summary").select range("c" & rows.count).end(xlup).offset(1).value = y1 range("e" & rows.count).end(xlup).offset(1).value = y2 range("h" & rows.count).end(xlup).offset(1).value = y3 range("i" & rows.count).end(xlup).offset(1).value = y4 range("f" & rows.count).end(xlup).offset(1).value = "kwe" range("g" & rows.count).end(xlup).offset(1).value = "n/a" range("d" & rows.count).end(xlup).offset(1).value = "n/a" range("b" & rows.count).end(xlup).offset(1).value = y5 end if sheets("load").visible = true sheets("load").copy after:=sh sheets(sheets.count).name = "load" & sheets.count - 4 ' number of static sheets 'activesheet.name = range("d15").value sheets("load").visible = false end sub
Comments
Post a Comment