Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Reposting to get some answers......

Hi all,


I have couple of tables that can have many number of rows. The
number of rows can vary depending on the number of items that I need to

put into each table. The last row of the table is always will be "Total

and some number".


The work sheet contains may items and the above tables. The number of

tables could be anywhere from 1-5.


I am trying to generate a vba code that can copy only the tables from

this worksheet and then assort all the tables to new a worksheet with
an empty row in between the tables.


Is there a way to use range objects to get this done? How can we
specify a range object that is between the start of the table to the
end of the table?


Thanks in advance for all the suggestions.
shi

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reposting to get some answers......

Dim sh as Worksheet, rng as Range
Dim ar as Area
set rng = ActiveSheet.UsedRange.SpecialCells(xlConstants)
set sh = Worksheets("NewSheet")
for each ar in rng.areas
if application.Countif(ar,"*Total*") 0 then
ar.Resize(ar.rows.count-1).Copy _
destination:=sh.Cells(rows.count,1).end(xlup)(3)
end if
Next
sh.Range("1:2").Delete

Tables must be separated from other data by at least on blank row/column on
each side (or be on the edge of the sheet)

--
Regards,
Tom Ogilvy

"shishi" wrote in message
oups.com...
Hi all,


I have couple of tables that can have many number of rows. The
number of rows can vary depending on the number of items that I need to

put into each table. The last row of the table is always will be "Total

and some number".


The work sheet contains may items and the above tables. The number of

tables could be anywhere from 1-5.


I am trying to generate a vba code that can copy only the tables from

this worksheet and then assort all the tables to new a worksheet with
an empty row in between the tables.


Is there a way to use range objects to get this done? How can we
specify a range object that is between the start of the table to the
end of the table?


Thanks in advance for all the suggestions.
shi



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
Conditional delete (reposting). tom[_2_] Excel Discussion (Misc queries) 8 November 1st 09 10:41 PM
Reposting - Countif subtotals katagrga Excel Discussion (Misc queries) 2 June 5th 09 03:17 PM
Reposting for Match Value Macro Roger Excel Discussion (Misc queries) 0 February 26th 08 04:08 PM
Reposting - Why would this not Clear Cells Roger Excel Discussion (Misc queries) 4 January 30th 08 03:15 PM
Reposting for help with Outlook from Excel Jenny B. Excel Discussion (Misc queries) 2 January 14th 08 06:57 PM


All times are GMT +1. The time now is 11:44 PM.

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"