PDA

View Full Version : help with code please for arrays



maruduran
07-26-2012, 09:17 AM
I have a database where in a few fields there are more than one row of data. Like a fixed asset register creation as per legal requirements. In a particular category of asset, there maybe opening balance and more than one addition (on different dates in a financial year) and also similarly there may be more than one deletion on different dates. As per legal requirement, the depreciation is to be provided on the exact number of days (i.e. till the date of deletion and from the date of actual addition and also on the opening balance). In the enclosed sample data file, there would be more than one data relevant to columns I to L. For doing VBA program, how to go about I am confused. Whether these are to be put through an array code (for these columns there will be multiple rows). The date and value are relevant.
All your thoughts, suggestions and even criticism (constructive) would be welcome as I am a new entrant to this field.
Thanks in advance.

maruduran
07-26-2012, 09:20 AM
I want to add whether the database be split to provide for multiple values in these rows? That is do we have data in 2 different sheets with one key field and use VLOOKUP etc.

Bob Phillips
07-26-2012, 09:26 AM
You tell us a lot about what you have (even though much of it makes no sense to me), but I am not sure I got a question there.

If you are asking multiple sheets, answer no, avoid it.

maruduran
07-26-2012, 09:53 AM
Gentleman,
Do we duplicate all the other fields if a few columns have more than one value. I know we can use ISNULL or ISEMPTY. Apart from the legacy data, most data would come from Financial Books. Let me try to explain. The company may have grouped all tools in one category for depreciation purposes. Some new tools may have been added during the year and some put out of use and scrapped. There would thus be multiple values in different rows relating to single column. Since the lord of VBA Mr XLD says avoid multiple sheets, I should pick it from there. However, I would await further responses.
Thanks for the response.

Bob Phillips
07-26-2012, 10:00 AM
Yes, duplicate all other values.

You are essentially creating a flat file in Excel.