Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
large file - copy and paste small group CHEL294 Excel Discussion (Misc queries) 2 June 4th 09 09:08 PM
Sort, Copy, and Paste macro, must execute twice to work B. CLAY Excel Discussion (Misc queries) 2 May 26th 09 10:07 PM
Copy data and paste to different sheet named on Group Prem Excel Discussion (Misc queries) 1 February 21st 08 02:56 PM
Sort, Copy, Paste..without Autofilter..Anyone??? jeffg Excel Worksheet Functions 1 October 19th 05 05:34 PM
vba to sort group copy paste to another sheet mango Excel Worksheet Functions 0 November 5th 04 04:27 AM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"