LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Summary based on field indentifier?

I am wondering if someone may have an easy solution to help me create a
summary worksheet according to a special field identifier...

Here is the nuts and bolts:

I have a main worksheet with parts information:

A B C
1 Gear 1287 Gear for shaft A
2 Screw 22844 Screw for shaft A
3 Locking pin 2294 Locking pin for shaft B
4 Flange assy. 55499 Entire assembly for shaft A

Now what I would like to do is add a column and use something like an "x" in
it for the rows I want copied to a summary-like worksheet:

A B C
D
1 Gear 1287 Gear for shaft A
x
2 Screw 22844 Screw for shaft A
x
3 Locking pin 2294 Locking pin for shaft B
4 Flange assy. 55499 Entire assembly for shaft A
x

For this given range, I would like to build a summary worksheet with "x" as
the special identifier to copy it over. Does anyone have something like this
put back in their toolbox? I would be most appreciative.

Many thanks in advance...

Here is the only thing I have come up with so far, but I would like a better
solution to copy over only the fields with an "x". In other words, I would
like to see if anyone has a better solution...


'' this sub is a mod from dmjritchies deleterow by blank character in column
A
Sub DeleteRowsByChar(CharacterToDelete As String)
Dim Rng As Range, ix As Long
Set Rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For ix = Rng.Count To 1 Step -1
If Trim(Replace(Rng.Item(ix).Text, Chr(160), Chr(32))) =
CharacterToDelete Then
Rng.Item(ix).EntireRow.Delete
End If
Next

End Sub

Sub Macro1()
Dim main As String, Xs As String, Os As String

main = "Main"
Xs = "Xs"
Os = "Os"

Sheets.Add
ActiveSheet.Name = Xs
Sheets(main).Select
Cells.Select
Selection.Copy
Sheets(Xs).Select
Range("A1").Select
ActiveSheet.Paste
DeleteRowsByChar ("")
Range("A1").Select

Sheets.Add
ActiveSheet.Name = Os
Sheets(main).Select
Cells.Select
Selection.Copy
Sheets(Os).Select
Range("A1").Select
ActiveSheet.Paste
DeleteRowsByChar ("x")
Range("A1").Select

End Sub





Mark Ivey

 
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
Summary based on highlighted cells Vic Excel Discussion (Misc queries) 4 June 10th 09 01:23 PM
pivot table- need cell indentifier to repeat in each row joeinnc Excel Worksheet Functions 11 May 12th 09 04:24 PM
calculate a field based on value of another field dlb1228 Excel Discussion (Misc queries) 2 April 16th 08 03:22 PM
calculated field based on data field Vanessa Excel Discussion (Misc queries) 0 February 20th 08 01:57 AM
Summary field highlighting. Bill Excel Discussion (Misc queries) 0 August 30th 06 10:39 PM


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