Grouping Of Rows Dynamically

Oct 21, 2009

I am having a problem with a VBA macro I am trying to write. All I want to do is check all rows in a worksheet and group rows from the last bold row to the next bold row.

I seem to have the conditional logic correct, however, instead of grouping rows separately in each loop, it keeps joining them together.

View 6 Replies


ADVERTISEMENT

How To Dynamically Insert Rows With Duplicate Data Of Previous Rows

Oct 30, 2013

I have a spread sheet with values in the area of A1:H834

In column H, I have number values from 1-7.

Essentially that number value means that the values in the row are duplicate.

So, for example, if H2 has a value of 4, that means that $A$2:$G$2, really should have an additional 3 rows underneath with the EXACT same data in each cell, however, the way the sheet was created, was to remove the duplicate values and just indicate in column H, the number value of how many duplicates $A$2:$G$2 really is.

I need to unpackage this and create what it was originally. What type of formula can I use, to look at the value in H2, and then insert underneath that number of rowes with the exact same data as A2:G2 and do the same for the remainder of the table all the way down to A834:G834

View 1 Replies View Related

VBA Grouping Selected Rows

Feb 4, 2005

I have VBA code which selects a group of rows ranging between 1 row and 25 rows. I then want code to group the selected rows, however, the only code I know for grouping requires that I enter a specific starting and ending row (ExecuteExcel4Macro "SHOW.DETAIL(1,#,FALSE,#)").

Is there a way to have VBA group and hide a number or rows which is not known in advance and will change between daily executions of the code?

View 3 Replies View Related

Minimum Value In Grouping Of Rows

Apr 26, 2012

I have a grouping and subgrouping of rows in my worksheet and I want to use the minimum value from each group and subgroup and use those values in a report on a separate worksheet using vba. Here's the situation

Emp List (Column)__________________________ Salary
- Workers
__+ Foremen
__- Juniors
____John__________________________________2000
____Max___________________________________1800
____Sandra_________________________________1925
- Management
__+ Seniors
__+ Middle

Lets say Max has the lowest salary among all the workers then I want the report to look like this

Emp Group__________ Emp____________________ Min Salary
Workers____________ Max____________________ 1800

Can I do this using vba without multiple loops at all the group levels?

View 7 Replies View Related

Delete Last X Rows Dynamically

Dec 17, 2012

Is it possible to run a macro that will delete the LAST X rows? It must be dynamic, and now be fixed to a specific row.

View 8 Replies View Related

How To Dynamically Delete Rows

Mar 30, 2009

I am trying to delete many rows in a spreadsheet with over 45000 records. There are 10 columns and column B is the determinant of whether a row should be deleted. The criteria is that if column B contains format like 'P00000xxxx, then it should be retained.

Otherwise, the whole row will be deleted. I started to record some codes but then was stuck with the deletion portion.

Below are the codes that I tried to use:

Dim rng As Range, PCrng As Range, PCstring As String

Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Set rng = Range(Selection, Selection.End(xlDown)).Select
For Each PCrng In rng
If PCrng.Value " 'P00000xxxx ' I don't know how to search this format, the last 4 digits will vary from case to case.

then delete the row

View 9 Replies View Related

Grouping Rows Based On Value Of 9 Cells?

Jun 5, 2012

I have a permutation with repeatition of 3 letters in 9 digits 3^9, and I'd like to be able to group all posibble permutations something like:

BBBBBB+2+1 = BBBBBBCCD = 252 rows
BBBB +3+2 = BBBBCCCDD = 1260 rows
5+4
5+3+1 and so on

View 2 Replies View Related

2-level Dynamic Grouping Of Rows

Jul 8, 2008

I have a spreadsheet that requires grouping at two levels. See pasted image below.

I need a macro that on the first pass dynamically creates groups of different sizes of data based on values of one column. For example, a group is created for the RR's, a group is created for the SS's, and a group is created for TT's.

On the second pass I would like to group the groups based on the values of another column for the 2nd level of grouping. So the A's would be one group and the B's would be the other.

TotalAAToTalRRARRARRARRAToTalSSASSASSASSATotalTTATTATTATTATotalBBTotalUBUBUBTotalVBVBVBVBVBTotalWBWBWBWB

I can have 2 tables set up for the values that I need grouped at each level.

Table 1Table 2Group 1Group 2ARRBSSCTTUVWXY

I had recorded a macro where I manually grouped the data. However, this did not help, because I am creating a template that needs to dynamcally handle the data that comes in.

View 9 Replies View Related

Dynamically Hide/show Rows

Feb 17, 2010

I have a spreadsheet that has been set up with totals at row 1010. The data that the spreadsheet contains only goes up to row 159. However data will continue to be added row by row over time. At the moment I have to keep hiding and unhiding rows to check the totals. Is there a way so that the spreadsheet will automatically hide all but five rows between the last row with any data in and the totals at the bottom of the spreadsheet?

View 9 Replies View Related

VBA For Automatically Grouping Rows Based On Text

Jul 7, 2009

I have a pivot table (vendor spend report) which has over 7000 rows of data. There are 38 vendors (some vendors appear multiple times i.e. Accenture Itay, Accenture Germany, etc.). Vendors names are in column B.

I need to have the VBA script search for each of the vendors (and related names) and group them together. Also, last one is for all the MISC. vendors which need to be group together (one's that dont belong to the 38 managed vendors).

Also, I need to rename the Group for each one; rather than Group1, I need to name it "Accenture All" etc...

View 7 Replies View Related

Pagebreaks: Grouping Rows Together So Print On Same Page

Feb 27, 2007

I have a report that shows 3 lines for each item. Is there a way to group sets of 3 rows together so they print on the same page so that it would insert a page break either before or after each set of 3 rows, not between them.

View 9 Replies View Related

How To Keep Rows Of Data Together When Dynamically Linked To 2 Columns

Apr 30, 2014

I am trying to set up a new assurance work book and worksheet (worksheet2 lets say) which will dynamically link to another workbook and worksheet (worksheet 1) owned by another part of my business. The purpose using the data set in worksheet 1 is that this is the source data and is the most accurate for the project information. So I am looking up columns A, B and C in that workbook in my new worksheet2 using ='[Spreadheet 1.xlsx]Sheet1'!$A$1:$A$1174 the same for column B and C, with the aim that any new data entries within columns A, B and C will be populated in worksheet2.

In columns D to Z of worksheet 2 (my worksheet) I am applying some assurance metrics to the project information that is specific each row of column A, B and C which are dynamically linked to woorksheet1. My problem and it is completely eluding me is this....

The owners of worksheet1 regularly sort the data into chronological order based on Column A. However the data is not normally presented in this way i.e. all new entries regardless of date are added to the list at the bottom of worksheet1. The problem I have is, is keeping my row data in Columns D-Z linked to the row data in columns A-C of worksheet2 no matter what kind of sorting occurs to Columns A-C in worksheet1.

View 1 Replies View Related

Formula For Transposing Rows Vs Columns Dynamically?

May 10, 2012

I have an Excel Sheet1

The sheet has horizontal info a list of "headers" going horizontally across row 2. So row 2 may have A2= Date, B2=Name, C3=Style, D3= ........

The header rows will vary in some cases. I want to use a formula to copy and transpose the information to Sheet2. I would like the list of headers to go vertical instead of horizontal. So A1=Date, A2-Name, A3=Style, A4= ..... all the way down.

I know about Copy -> Special -> transpose but I need something that is dynamic and simple. I know I can use the indirect function and do something like this =INDIRECT( "Sheet1!" & ADDRESS(1,2) ) . However I was trying to figure out two things. How best can I make the columns dynamic and increment up especially if I am not starting at A1? Is there a better formula to use that is not volatile like INDIRECT?

View 3 Replies View Related

Inserting Rows Dynamically With Values From Other Sheets

Apr 12, 2007

We have a scenario like this:

1. Data (Let's say 5 fruit names are entered) will be entered in sheet1 (row wise)
2. Data (Let's say 5 flowers names are entered) will be entered in sheet2 (row wise)
2. Entered data in sheet1 and sheet2 should get automatically populated in sheet3 under respective headers (header 1 - fruits and header 2 - flowers)

Rules : 1. We will have Headers with one default empty row
2. With addition of every row in sheet1 or sheet2, a row should automatically inserted in sheet3 under respective headers and populate data.

View 6 Replies View Related

Totally Ungroup Existing Grouping Of Rows In Sheet?

Feb 3, 2012

I need to totally ungroup existing grouping of rows in a sheet. Totally ungroup = strip it totally of any grouping. In short, it should be back to its original state of no grouping at all.

Problem is that I do not know if the sheet has existing grouping, or if it does, how many levels of grouping.

The solution I have in mind right now is just to indiscriminately run ungrouping vba line 10X and just place an error handler i.e.

Code:
Sub Macro1()
On Error Resume Next
Range("A5:A29").Rows.Ungroup
Range("A5:A29").Rows.Ungroup
Range("A5:A29").Rows.Ungroup
Range("A5:A29").Rows.Ungroup
Range("A5:A29").Rows.Ungroup

[code].....

Is there a shorter way to handle this code-wise?

View 3 Replies View Related

Grouping Together

Feb 28, 2009

Sheet1 presents my "achievement".

Sheet2 shows what I'm after.

Can this be done WITHOUT any help columns/tables - just by using worksheet formulas?

View 6 Replies View Related

Sum Function In Grouping?

Jun 30, 2014

How do I sum only the total in various groups? I can highlight the cells to get the total but when using the sum function I get the hidden rows too.

View 5 Replies View Related

Grouping The Tabs..

Oct 13, 2008

Is there a way to group tabs? For instance, I have 3 tabs that go with one section and 3 with another and so forth. Is there a way to group them? Also, can you change their color?

View 3 Replies View Related

Grouping Duplicates...

Feb 26, 2009

I have a table in excel that contains many rows, each row being a product. Each row has a product ID, and should be unique, but there are multiple instances of products in the table, some that are duplicate and some that contain different info (product notes, description, etc).

What I would like to do is group the products by product ID, so that I can show the different occurances of the product within each product ID, so that we can weed out the unique values within the duplicate products by ID. Is there any easy way to do that?

excelexample.jpg

View 4 Replies View Related

Grouping In A Graph

Jun 16, 2009

I would like to create a graph where the numbers are grouped in such a way as all numbers between 0 and -1 are shown in one column, all numbers between -1.1 and -2 are shown in the next column, all numbers between -2.1 and 3 are shown in another column etc

The numbers are shown below

11/03/09
-2.5
-3.8
-3.9
-4
-4.1
-4.5
-4.6
-4.9
-5.2
-5.4
-5.4
-5.5.......

View 2 Replies View Related

Sum If And Grouping Dates

Oct 28, 2009

See attached spreadsheet. I would like to take all the departments (column a) and all the dates (column b) and group them. Then add up the sums for columns (e and f) respectively. See desired result in spreadsheet for entire range. How do I do that?
This is in excel 2003. So cant use sumifs.

View 4 Replies View Related

Grouping Within IF Statement?

Jan 31, 2013

Create an =IF() statement that divides the infants into four - lb. age groups (beginning at 10 lbs.) and assign a 1 to the lowest group, a 2 to the second, and so on.

10-14
14.1-18
18.1-22

for the three groups

View 1 Replies View Related

Grouping With Pictures

Mar 18, 2013

I have grouping setup in my excel spread sheet.

1. I added pictures(print screen-->mspaint-->cut existing part of the image-->paste into excel. In excel they are called "Pictures 01 thru Picture X" with the pull points all around.
2. I located them in specific cells of the grouped type with the (-) sign appears so the group of cells are in use
3. When I close the Group(+) of cells all the pictures are jumbled above the closed cells.

Question: Is there away to keep these pictures within those cells when closing the group, so they will not been see as well?

View 1 Replies View Related

SUM Results According To Grouping

Mar 14, 2014

I have a workbook that calculates the total sales per agent but looking a datasheet. At the bottom of the sheet I have 4 team managers who look after a group of agents. I need their totals to me calculated by summing each of the agents in the teams.

I have tried to create groups per team_manager using my team_ref_sheet. On this sheet I have Defined Names / Named Ranges which I thought would work for doing these calculations, but this does not seem to have worked.

View 5 Replies View Related

Grouping And Averaging

Dec 2, 2008

The organisation I wish to report on has many cost centres which each contain many people. These people are on many different grades, and each are on differing salaries (even those in the same grade).

One “reporting group” has many cost centres.

There are several reporting groups.

I need to report on average salary per grade / per reporting group.

I have attached some dummy data. The “rep group” tab displays the reporting groups and the cost centre mappings (ie reporting group England contains cost centres 1, 2, 3, 4, 5, 6 and 7). Note in reality the cost centres are not this simple, they are 6 digits and varying ranges.

In the “salaries” sheet each individual is listed along with their cost centre (in column c) and their grade (column d). Their salary is shown in E.

View 11 Replies View Related

Grouping Like Items Together

Apr 16, 2009

I am working on a set of data and need to group items in the same style together.

Example: ...

View 10 Replies View Related

How To Sort In Grouping

Sep 8, 2013

I want to be able to sort product inventory information. The report generated for me shows on-hand inventory for each product in each warehouse (there are many rows in the spreadsheet per product - i.e. each product/warehouse combination has its own row).

I'd like to sort the table based on most total inventory per product, but maintain the products in their groupings. I know I could do a pivot table and sort it - the problem is, I want to able to see the warehouse distribution for each total. A pivot table would just give me the overall total without the breakdown per warehouse.

Here's an example:

Product #
Warehouse
Inventory

547
100
628

[Code] .......

From this, total inventory for product 547 is 694 units. For product 2091 it's 2,153 units. For product 1165 it's 286 units.
Therefore, I'd like the 2091 grouping to come first (all of it - including the rows showing 0 inventory), followed by the 547 grouping, followed by 1165 grouping.

View 1 Replies View Related

Automated Grouping Using VB

Oct 20, 2008

I have a large excel sheet that will take a lot of time grouping it manually, so I was wondering if there was some way somebody could help me out with creating a code in VB to automate this grouping for me. All I would need is something to read through the rows of one column and when it finds a blank row, keep scanning until the next blank row and then group the data between the two blank rows. I have attached a small portion of the excel sheet I am working with if you need to get a visual of what I am needing.

View 9 Replies View Related

Grouping By Year ...

Feb 17, 2009

Is it possible to grp data in an excel sprdsheet by year or month and also is it possible once that is done to have an option of totaling each period?

On a separate point, but similar:

i have a spreadsheet in one of the columns i have a unique reference eg opal.... at the beggining with some other digits eg opalmimi, or opalniuj.

so i have like 20 or thirty rows (maybe more) of data .

What i would like to do is to sort by the column begining with the opal wildcard and grp and subtotal each wildcard grp

so my sprdsheet looks like this:

Date Desc (where opal values are entered) Amount

View 9 Replies View Related

Grouping The All Dates

Dec 28, 2009

I have my date list in a2:a503 with weekly dates ie. 2/12/2009, 9/12/2009, 16/12/2009 etc etc,
what I would like to do is 1st group all these dates as dec 09 in b2:b503, 2nd point is I would like to have cell c2 to have lowest date (in my example 2/12/2009) and d2 to have the highest (which is 16/12/2009) of that month

ie start date 2/12/2009 end date 16/12/2009.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved