Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba to sort group copy paste to another sheet
dear all, need help from the forum.
if i want to sum the same material in (column c) together with qty (column d) and price (column o) and put in new sheet using vba. i want to automate by click on button and put in another sheet. i need to sort and group and sum up the price and qty by different material. my problem now is 1)starting row could be different. 1 time is row 15 but other time could be 20, etc. 2) in between row sometimes there is a blank row and sometimes no blank row. 3)how to paste special by value automately 4)columns no change. which means i only make use of column c, d, o 5) how to know which row to start and end at which row as in between having empty rows. format something like this. in between item sometimes there is a blank row or sometimes no blank row. and also i need to sort and group as material not in sequence. starting row also can vary. sometimes at row 15 other time could be 18. item desc material qty price 1 head k123 3 45 blank row 2 shell k123 5 50 blank row 3 stiff k234 9 35 4 giant k567 4 60 5 shell k234 7 30 blank row 6 shell k123 5 60 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba to sort group copy paste to another sheet
Paste Special by Value: Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks: _ False, Transpose:=False Determining the last line so that you donīt worry about blank spaces: lastline = Cells(1, 1).End(xlDown).Row If the line is blanks skip it: if(activecell.value)="" then activecell.offset(1,0) end if I hope this helps. E.H -- ehnt ----------------------------------------------------------------------- ehntd's Profile: http://www.excelforum.com/member.php...fo&userid=1586 View this thread: http://www.excelforum.com/showthread.php?threadid=27553 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
large file - copy and paste small group | Excel Discussion (Misc queries) | |||
Sort, Copy, and Paste macro, must execute twice to work | Excel Discussion (Misc queries) | |||
Copy data and paste to different sheet named on Group | Excel Discussion (Misc queries) | |||
Sort, Copy, Paste..without Autofilter..Anyone??? | Excel Worksheet Functions | |||
vba to sort group copy paste to another sheet | Excel Worksheet Functions |