Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Subtotal - copy to other worksheet

Hi,

I would be much appreciated if you can help me how to set the code. I know
how to use Subtotal and filter 2 for subtotal and copy to other worksheet by
manually. Is there a way to set macro automatic to hit to copy to other
worksheet with subtotal and grand-total only without detail records.

YOur help much appreciated.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Subtotal - copy to other worksheet

i've used something like this

Set rng = Range("i4:j" & lastrow)

For Each cell In rng
If UCase(Left(cell.Formula, 11)) = "=SUBTOTAL(9" then
' then put your copy code here
next
end if



--


Gary


"Bill" wrote in message ...
Hi,

I would be much appreciated if you can help me how to set the code. I
know how to use Subtotal and filter 2 for subtotal and copy to other
worksheet by manually. Is there a way to set macro automatic to hit to
copy to other worksheet with subtotal and grand-total only without detail
records.

YOur help much appreciated.
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Subtotal - copy to other worksheet

Assume you have your subtotal formulas in Column 5 and your detail data does
not contain formulas in column 5

Dim cell as Range, rng as Range
Dim col as Long
col = 5
on error resume next
set rng = Columns(col).SpecialCells(xlFormulas,xlNumbers)
On error goto 0
if rng is nothing then
msgbox "Nothing to copy"
exit sub
End if
for each ar in rng.Areas
With Worksheets("Summary")
set cell = .Cells(rows.count,col).End(xlup)
set cell = .cells(cell.row+1,1)
End With
ar.EntireRow.copy
cell.PasteSpecial xlPasteValues
cell.PasteSpecial xlPasteFormats
Next


--
Regards,
Tom Ogilvy



"Bill" wrote in message ...
Hi,

I would be much appreciated if you can help me how to set the code. I

know
how to use Subtotal and filter 2 for subtotal and copy to other worksheet

by
manually. Is there a way to set macro automatic to hit to copy to other
worksheet with subtotal and grand-total only without detail records.

YOur help much appreciated.
Thanks




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
Copy within a subtotal nitengale Excel Discussion (Misc queries) 1 May 29th 10 04:49 PM
To copy subtotal into another sheet pol Excel Discussion (Misc queries) 3 February 8th 09 03:20 AM
copy subtotal value only - also can be lookup from other worksheet BB Excel Discussion (Misc queries) 1 June 30th 06 09:12 AM
copy subtotal value only, subtotal value can be vlookup by others BB Excel Discussion (Misc queries) 1 June 28th 06 11:10 PM
Copy and paste subtotal to another worksheet JC[_9_] Excel Programming 1 August 1st 04 10:02 AM


All times are GMT +1. The time now is 06:02 AM.

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

About Us

"It's about Microsoft Excel"