How to conditionally copy the data rows from one Excel Worksheet to another -
i have list of projects , project details in "project master" excel worksheet placed in 4 columns: project type, project numbers, project value, , project managers' names. want write macro copy content of these 4 columns "project master" worksheet worksheet ("details") in same workbook if row contains project type "a". possible? regards, ck
pertinent task description, sample worksheet content may shown in following table:
type num value manager name b 3 3.14 i. newton 5 2.71 t. edison c 8 9.95 h. ford 1 4.99 s. jobs d 4 21 g. leibniz and corresponding sample vba sub copydetails() perform task shown below:
sub copydetails() dim ws worksheet dim lastrow long set ws = thisworkbook.worksheets("project master") lastrow = ws.cells(ws.rows.count, "a").end(xlup).row = 2 lastrow if (ws.range("a" & i) = "a") ws.range("b" & & ":d" & i).copy destination:=worksheets("details").range("a" & i) end if next end sub alternatively, may set reference excel worksheet objects e.g.:
set ws = thisworkbook.worksheets("sheet1") hope may help.
Comments
Post a Comment