Create Hierarchy Of Data Types

Apr 28, 2009

My question is about creating a hierarchy of Data Types.

I need to code 3 Data Types:
1.) MealPlan
2.) Meal
3.) MealItem

MealPlan represents a daily meal plan. It should have a certain number of meals. An example of MealPlan would be "Healthy" and have a total of 3 meals. Meal represents a single meal. It should have a certain number of meal items. An example of Meal would be "Meal 1" and have a total of 3 meal items. MealItem represents a single meal item. It should have a certain number of protein calories, fat calories, carb calories. An example of MealItem would be "Broccoli" and have protein calories of .2, carb calories of .8, fat calories of .1.

By using Data Types, I hope to create meal plans, which are made up of meals, which are made of meal items. The following code creates a Data Type hierarchy for two Data Types. I've examined it closely but i'm still having a hard time recreating it for my needs as stated above.

View 3 Replies


ADVERTISEMENT

Create Parent Child Relationship From Hierarchy

Feb 7, 2008

I have an excel file (see sample attached) with a hierarchy with parents and children spread across different columns and rows. However, I am trying to condense it into one column with parents and one column with children. The only way I've been able to do this is by copying and pasting parents onto children rows, which is both a manual and time-consuming process (when you have a lot of rows). I feel like there must be a way to use VBA or a formula or something to get it to work. I have attached a sample, so you can see what I am trying to do (current data and desired data).

View 6 Replies View Related

Create Macro That Just Types 'special' At End Of Cell

Jul 10, 2008

I have something I've been trying to figure out for quite some time. I have to add the word 'special' at the end of various cells that has text already in it. Is there a macro that does this? Everytime I create one, it wipes out the text and adds the word 'special' instead. I need it to add the word 'special' at the END of the text that's already in there.

View 9 Replies View Related

Creating A Hierarchy Of Non Numerical Data ?

Jan 28, 2009

I need to create a table of non numerical data that I can refer to in a formula, which will compare two pieces of data (both also inside this table), and based upon which is "higher up in the hierarchy" - the cell will display a certain result.
Basically it will be an IF function using non numerical data that has a numerical value / "rank" attached.

Specifically - I need to allocate values to this list in cells A1:A5...
EUR
GBP
AUD
NZD
USD
....where EUR is highest ranked and USD lowest.

Then in column B and C will be listed each of these values but in various combinations. In column D I will build simple IF functions to show the highest ranked in each combination. eg B1=EUR C1=GBP D1=IF(B1>C1,B1,C1)

View 3 Replies View Related

Roll Up Data Based On Hierarchy

Dec 4, 2011

I have case where i need to roll up data based on the hierarchy. I have hierarchy of 4 level as follow:

Level1 Level2 Level3 Level4 Country Region1 Dept1
Unit 1 Country Region1 Dept1
Unit 2 Country Region1 Dept1
Unit 3 Country Region1 Dept1
Unit 4 Country Region1 Dept1

[Code] ........

The data in all sheets is identical...so I created a macro to create template based on the rage. The problem is that the template is good for level 4 but not good for other level.

View 2 Replies View Related

Rearrange Data In Hierarchy To Table

Jun 6, 2007

How do I use VBA to rearrange the data from the hierarchy format of Table 1 into the flat format of Table 2. See attached file >Data_Belinda_June-5-07.xls

Table 1: Each record has information arranged in a hierarchy format.
Level 1 information is indented by one space on one line; Level 2 information is indented by 2 spaces on the next line, etc.

Table 2: Data from Table 1 have been rearranged into 7 columns. Another column has been added to create a field for the Reference ID.

Reference ID: Two types: i) Created by prefixing with the letters BI , adding the first four letters from column 4 and the first four letters from column 5; ii) As in (i) with the addition of the entire word from column 6.

The report I have may have more than one hundred records and there may be more than ten people within each section.

View 9 Replies View Related

Get Hierarchy Chart Automatically With Given Data Through Macros

May 25, 2014

I have been trying to think of a way to get a hierarchy chart automatically with given data through macros
In the attached excel sheet

Org. Charts (hierarchy) question.xlsm

Would it be possible to get the chart to do by itself if say I were to add items or remove items? Is there any way to do it for data automatically?

I extract the data from primavera as attached and I want to make the chart in excel automatically.

View 3 Replies View Related

Incompatible Data Types

Sep 8, 2009

I have a problem concerning datatypes for an if-loop, the failure message tells me "Datatypes incompatible" for this code-line:

View 14 Replies View Related

Different Calculations For Different Data Types

Mar 8, 2012

As a complete novice....I want to:

1. Create a list of 3 different types of projects

2. Write three different types of calculations that should be undertaken dependent on the type of project. Each will be in a separate worksheet.

3. Make sure once I've checked the project type I apply the right calculations that match the project type

4. Summarise the results of the calculations against each of the projects

Can I do this just in excel or do I need to use macros?

View 9 Replies View Related

User-Defined Data Types

Apr 12, 2009

My question is about creating User-Defined Data Types. Is there ANY way possible i can create a User-Defined Data Type that declares a variable of another User-Defined Data Type instead of the Pre-Defined User Types like String, Integer, etc?

The following explains my problem in more detail.

I know to create a User-Defined Data Type at the top of the module before any procedures. Like this:

View 6 Replies View Related

Formatting Charts With Different Data Types

Jan 3, 2012

I have three items I would like to graph, on one chart. The first is %Complete. This is a number figure. The next is the date the item is due to ship. Obv, this is a Date. The third is today's date. Basically, I would like to display in the same chart so that we can see how far a long a project is, in relation with today's date and how much longer we have until it needs to ship.

This is the current display of the chart:

Is there a way to show the ship date, as the 100% complete mark? In order to make it display half-way decent, I had to format the left y-axis to go above 100%. I first tried to format the right y-axis, but was extremely confused to setting values. I figured out that the end date is somewhere in the 40,000 value mark? WTF is this about? Is 1 equal to 24 hours? I assumed that was the case, but then when I pick the value it should end with, it doesn't seem to react that way. I want the right axis to start with 12/01/2011 and end with 5/01/2012. How can I achieve this?

View 3 Replies View Related

Data Types When Opening CSV Files

Sep 20, 2012

I have a csv file. When I open it by double clicking, all the finance figures appear as currency with the currency symbol. I can use the SUM function on these and it's perfect.

However, when I open this file using a macro, these same numbers look the same, except that they are now left justified and are text because the SUM function no longer works. If I select a range, I get the count of the number of items selected showing at the bottom of the screen but not the sum.

I have tried opening the file using the OpenText function which has several ways of setting a date format to the fields but nothing for numbers.

I have even tried, in the macro, selecting a cell with numeric 1 and then selecting the range and pasting the 1 as a multiply function but this doesn't work either.

View 2 Replies View Related

Structures Or An Arrays Of Different Data Types.

Sep 19, 2008

I an newbie at VBA but I took some short programing classes back at my college days. I am trying to declare an array with different data types and since that seems to be imposible for what I gather then my other option is to declare what I remember as a structure.

View 9 Replies View Related

Comparing Multiple Types Of Data

Jul 18, 2009

In one excel book I have 2 sheets.

1. One sheet (request type wise) contains request type and the phase which it belongs to. eg request type A belongs to phase 1 and request type B belongs to phase 2. (like wise there are 212 request types divided into 8 phases)

2. The second sheet contains raw data (request type) where the request types are randomly arranged.

What I am trying to do is:

Compare the raw data of sheet 2 with standard data in sheet 1 and paste the phase to which it belongs to with a help of macro/code, since the standard data (212 request types with 8 phases) is huge.

View 9 Replies View Related

Assign Variable To Different Data Types

Oct 12, 2007

Putting the final touches on a project I have and the last element doesn't work 100%. the scenario: I have a function that I wrote based on the user's input of the desired column to perform the operation. As a method of error-trapping and ease of use, I set instructions for the code to activate:

1) if the user highlights multiple cells of the desired column
2) enters the letter of the column (up to "z", not case sensitive)
3) enters the number of the column

Sub Button5_Click()
Dim ColumnUsed As Variant
' find number of columns selected
For MyColNum = 1 To Selection.Columns.Count
Cols = Cols + 1
Next MyColNum
'find number of rows selected
For MyRowNum = 1 To Selection.Rows.Count
Rows = Rows + 1
Next MyRowNum..............................

View 2 Replies View Related

Geographic Coordinate Data Types / Formats

Feb 15, 2008

I often find that it would be useful to have a data type for geographic coordinates (i.e. latitudes and longitudes) that would e.g. permit/facilitate formatting negative values as South and West, direct subtraction of one latitude/longitude from another, conversion of degrees-minutes-seconds to decimal degrees, properly formatted axis labels when using Excel to draw maps (at the moment, I am editing the axis labels in the PostScript file by hand, when I don't use chart labeller to paste axis labels in) and so on.

(Time formats could be used, if only they could be prevented from converting hours over 24 to days, which I have not found out how to do.)

Therefore: does anyone know of any Add-In out there somewhere that could supply the lack of a geographic coordinate data type?

View 8 Replies View Related

Copy Non-contiguous Cells And Varying Data Types

Nov 4, 2013

I have a non-contiguous range of cells that contains Values, Formulas, Text or Dates. In some cases a field containing a value could instead contain a formula depending on who is filling out the form and/or what information is known. For example, a cell might contain a value, i.e. Utilities, and I might either know the total ($76,310), or I might need to perform a calculation right in the cell to obtain the total (=54236+9587+12487).

My goal is to be able to copy the information contained in this non-contiguous range to the right some 52 columns (this is a safe temporary storage location) and then be able to copy it back should I need to.

One other problem may be that the source cell might be a merged cell.

Since I cannot determine whether the information is going to be a value or a formula, and I have some text and date formats to copy as well, is there some way to copy this range and keep the data regardless of format?

My Range might look like: (F4, C5, D6:D7, D9, D13:D15, D17:D18, D22:D25, D27:D30)

F4 is a date field, C5 is a merged cell holding text, D6 is the Utilities field described above. The other fields are all formatted as dollars or percentages.

View 7 Replies View Related

Hyperlinking Texts In Hierarchy Chart?

Jul 2, 2013

I have created a hierarchy chart using smartart. Is there a way to hyperlink the texts in each box to other sheets in the workbook?

[URL]

View 3 Replies View Related

Creating Multiple Drop Box In Hierarchy

Apr 30, 2009

I did all the search for multiple drop box or list box that can connect to other list boxes but no luck.

It's the same as when you surf with Internet Explorer, you can click "Views" in menu bar, list box appear and then choose "Encoding", another drop box appear, then when you choose "More", then another box appear.

Is it possible to have this sort of hierarchy list box in excel where drop box connect to another drop box?

View 6 Replies View Related

Multiple Criteria On Index / Match With Hierarchy

Dec 29, 2011

The below formula was provided by PGC, and works great:

=INDEX($E$15:$E$18,MAX(IF($A$2:$A$8=A15,MATCH($E$2:$E$8,$E$15:$E$18,0))))

In post:
Complex Array(?) Search

Now, I would like to add the ability to perform this same action/concept, but using two different criteria.

So I want to keep the hierarchical listing of importance, but lookup/match within using more than one criteria.

Example:
I have an order of superseding to apply to results of a search for Fruit.
Great
Good
Fair
Poor
(so Good supersedes, Great; Fair supersedes, Good; etc.)

Column A____Column B____Column E
Apple_______Red_________Fair
Apple_______Red_________Poor
Apple_______Green_______Great
Pear________Red_________Great
Pear________Yellow_______Great
Pear________Red_________Good
Pear________Red_________Fair

I want my verification to return all the worst Red fruit:
For Apple Red: Poor
For Pear Red: Fair

View 1 Replies View Related

Change Vertical Rolling Hierarchy To Horizontal

Sep 19, 2007

The accounts listed on this report change on a monthly basis. I am attempting to create a macro or write a formula that can but used each month to fill in this list automatically. On Sheet 1 is a short example of what the report looks like when exported into excel. The numbers on the left are the numerical hierarchy. The long set of numbers are the account numbers and the others are the categories that each are located under.

Sheet 2 is what I need the end result to look like. One of the problems I am running into is how to handle the fact that the hierarchy re-uses numbers. The hierarchy always runs vertical, therefore "5" always falls under the "4" that is directly above but when there is another "4" it should be ignored and continue on up the chart until it finds the first "3" and place that in the cell to the right then find the first "2" and so on.

View 2 Replies View Related

Slicer Hierarchy Value Sorting - Selected Values Won't Sort To Top

Nov 25, 2013

I have two slicers that are in a hierarchy. These are attached to a Pivot table whose data source is an OLAP cube. Every Partner Parent is part of a Partner Group:

Partner Parents Slicers.png

My problem is that when I click SI Alliance in Partner Group, the Partner Parent slicer does not re-sort in any way. The corresponding selected Partner Parents are scattered throughout the alphabetical list. However, in a different document, I have slicers in a similar situation, except their Pivot table’s data source is a SQL Server database. When I click on a member of the higher up group (Accenture Global Client) the lower level group (Microsoft Account Name) sorts to show only the selected values at the top of the list:

This is with all selected - Accenture Slicers All.png

This is with just one Accenture Global Client selected. Note how the selected Microsoft Account Names have moved to the top of the list - Accenture Slicers Selected.png

How I can configure my Partner Parent/Partner Group slicers to behave like these Accenture/Microsoft slicers? Is there something that I can change in Excel or in the OLAP cube to make this happen? I have already tried right-clicking the slicer and going to Slicer Settings. The settings on the Parent/Partner Group slicers mimic those of the Accenture/Microsoft slicers exactly.

View 4 Replies View Related

Got Stuck In Middle To Display Hierarchy Of Employee In Organization

Aug 5, 2014

I am supposed assign macro to track all employees hierarchy in an organisation.

In Sheet1 I have Employee ID's in D Column and Supervisor ID's in N Column.

And In Sheet2 I assigned macro...

What exactly I need is when I give number and click the button I need all the employee id's in his hierarchy

Concept:

The number which you give should search in N Column and Display D Column Values...and those D column values should search in N column and display D column values....so on.....

So far, it is showing 1 level hierarchy...but I need till end...

View 14 Replies View Related

Recursively & Conditionally Move/Loop Through Folder Hierarchy To Fill Array

May 7, 2008

i am use dir to put into an array all the folders in a folder then enter the first folder and repeat. the problem i am having is when it encounters a file it also puts it into the array and then errors once it trys to enter that "folder" (which is a file)

right now the code doesnt do anything but the plan is then to call another subroutine that lists all the files im looking for in a folder (that sub does work)

what am i doing wrong? all the things i can find on google show it the way i am doing it.

Sub GetDirList(topfolder As String)
Dim FolderArray() As Variant
Dim FolderCount As Integer
Dim FolderName As String

FolderCount = 0
FolderName = Dir(topfolder, vbDirectory)
' Loop until no more folders are found
Do While FolderName <> ""
If Not FolderName = "." Then
If Not FolderName = ".." Then
FolderCount = FolderCount + 1
Redim Preserve FolderArray(1 To FolderCount)
FolderArray(FolderCount) = FolderName
End If
End If

View 3 Replies View Related

Counting TYPES Of Duplicates

May 23, 2014

I have a dataset that has a good number of duplicates, many of which have more than 2 records.

In these sets of duplicates, there are two fields that have many combinations of values.

I would like to find a way to COUNT THE COMBINATIONS in all of the sets of duplicates, as in, every time there is a type of a certain combination of values, create a count for it:

12345 9 9
12345 9 0

123456 9 9
123456 9 0

(Total: 2) For 9/9 and 9/0

12344567 0 0
12344567 0 0
12344567 0 0

12344567 0 0
12344567 0 0
12344567 0 0

(Total: 2) For 0/0 3x

I have attached a listing of types of combinations that I found by scanning the database, but I don't know what formula or functions would do the trick. I don't think there is something in Subtotal or the Count functionality that would apply but I will fumble around.

View 11 Replies View Related

Filtering For Multiple Pay Types

Sep 9, 2009

I need to find the total $ collected on repair orders that contain customer pay and warranty repairs. The problem is that C and W show up on differerent rows, if an RO has 4 lines 3 may be c and 1 line w. I don't know how to use pivit tables to get the info I am looking for, or if that is the best way to fnd my answer.

View 8 Replies View Related

Sheets Contain Different Types Of Scores

Jun 17, 2006

some of the functions in this file, and the problem is that I have one bug I can't fix.

There are four sheets. The first two sheets contain different types of scores.

The fourth sheet ranks each of the different types of scores on both first sheets. The third sheet reports out on the bottom five scores in each category. If one of the scores is missing, the whole thing gets screwed up.

I have attached the file and removed a some of the scores to illustrate.

View 9 Replies View Related

Convert Variable Types In VBA

Jun 23, 2008

I want to sum the values of two userform text boxes however I assume they are stored as strings so I get 1 + 2 = 12 - how do you convert strings to integers in VBA? It seems as though it's different to VB where you'd just use convert.toInt16() etc

View 9 Replies View Related

Range Types Not Iterchangeable

Sep 5, 2008

I have portion of a macro that works when I specify a range like this:

        ActiveChart.PlotArea.Select        ActiveChart.SetSourceData Source:=Sheets(A).Range("O5:T41"), _        PlotBy:=xlColumnsEnd Sub

But I need one of the coordinates to be changeable on eacj round of the macro so I wrote this:

        ActiveChart.PlotArea.Select        ActiveChart.SetSourceData Source:=Sheets(A).Range(Cells(5, 15), Cells(B, 20)), _        PlotBy:=xlColumns

But when I executed the macro, it froze on this lines saying "Method of 'Cells' Global Failure. I need a way around this but I have no idea how at this point.

View 9 Replies View Related

Redim Custom Types

Aug 11, 2006

I want to have an array where each record contains a name and three numbers. My understanding is that Excel requires all element types within an array to be the same, and so I turned to a user-defined data type. But I don't seem to be able to create a dynamic array out of this type--when I try to ReDim Preserve it, I get an error saying that it's already defined. Can't I do that?

View 3 Replies View Related







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