Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Range Manupilation

one wb with several sheets containing a template for each product
Each template has three columns item#(empty rows) description(several
rows)and required quantity(empty rows). Description contains several
rows. This is a key factor
Since description is general you need to keyin the part# in the
required item. Example Screws are a general description but to order a
screw you have to look at the price list (the last sheet ) and pick the
correct screw and keyin the the item# and required quantity.

So, after you fill each template with the required items; you end up
with a list in each worksheet with partially completed lines.
Completed lines are lines that have the THREE fields Filled.

I need to create a summary sheet that contains ONLY the filled lines so
I can perform a Pivot Table on the filled lines.

Can you help me out

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Range Manupilation

Dim sh as Worksheet
Dim rng1 as Range
Dim rws as Long
for each sh in thisworkbook.worksheets
if lcase(sh.name) < "price list" and lcase(sh.Name) < "summary" then
if application.CountA(sh.Range("A2:C2")) = 3 then
rws = sh.Range(Sh.Range("B2"), _
Sh.Range("B2").End(xldown)).rows.count
if rws 4 then rws = 1
sh.Range("A2").Resize(rws,3).copy _
Destination:=worksheets("Summary").Cells( _
rows.count,2).End(xlup)(2,0)
end if
end if
Next

--
Regards,
Tom Ogilvy


"Arishy" wrote in message
ups.com...
one wb with several sheets containing a template for each product
Each template has three columns item#(empty rows) description(several
rows)and required quantity(empty rows). Description contains several
rows. This is a key factor
Since description is general you need to keyin the part# in the
required item. Example Screws are a general description but to order a
screw you have to look at the price list (the last sheet ) and pick the
correct screw and keyin the the item# and required quantity.

So, after you fill each template with the required items; you end up
with a list in each worksheet with partially completed lines.
Completed lines are lines that have the THREE fields Filled.

I need to create a summary sheet that contains ONLY the filled lines so
I can perform a Pivot Table on the filled lines.

Can you help me out



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Range Manupilation


A worm thank you for pointing me to the right direction.
You will not believe it, there was no single error It ran first time Mr
Genius.

"if application.CountA(sh.Range("A2:C2")) = 3 then"

It did not keep going to the rest of the sheet

I ran it on test data I only got the first line from each sheet. The
looping did not continue after A2.

I believe you picked 4 as an arbitrary max for column B where the
description of all items available for this product reside. Can I change
that to say 20 ( Max Possible for Column B)

You resized the range based on B2 while if you do it on column A you
will get number of rows I need to loop to finish each sheet. This of
course if I understand your logic.

Of course I will keep going but a chat will help a long way


*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Range Manupilation

I interpreted you description to be on item per sheet. That item would be
found in A2, B2, C2
If there were entries there, then B2 could have text in multiple rows below
B2

I put in the limit of 4 (it was arbitrary) in case you had only an entry in
B2 because that would go all the way to the bottom of the sheet.

So I would see your data

A2: Something
B2: Start of description
B3: Possibly More description
B4: Possibly More description
B5: Possibly More Description
C2: Something

that is what I made the macro look for and copy to sheet summary.

Apparently that isn't correct - but I don't know what is correct. Hopefully
you can adapt the code to your actual situation.

If not, send a small, sample, representative workbook to


Include all discussion to date. And perhaps include a sheet named "Sample
Results" with what the output would look like.

--
Regards,
Tom Ogilvy



"samir arishy" wrote in message
...

A worm thank you for pointing me to the right direction.
You will not believe it, there was no single error It ran first time Mr
Genius.

"if application.CountA(sh.Range("A2:C2")) = 3 then"

It did not keep going to the rest of the sheet

I ran it on test data I only got the first line from each sheet. The
looping did not continue after A2.

I believe you picked 4 as an arbitrary max for column B where the
description of all items available for this product reside. Can I change
that to say 20 ( Max Possible for Column B)

You resized the range based on B2 while if you do it on column A you
will get number of rows I need to loop to finish each sheet. This of
course if I understand your logic.

Of course I will keep going but a chat will help a long way


*** Sent via Developersdex
http://www.developersdex.com ***


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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


All times are GMT +1. The time now is 05:39 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"