Defining A 2D Array By Hand

Nov 22, 2009

I have to enter a 2D array by hand into code because I am doing it in PowerPoint VBA, but I can't find out how to enter a giant array manually.

I know I could do it like this:

MyArray(0,0) = 1
MyArray(1,0) = 2
MyArray(2,0) = 3
...
MyArray(99,99) = 10000

But obviously that would be a giant mess.

Couldn't I just define it like:
{0,1,2,3,4,5,6,7,8,9,...,99,100;
101,102,103,...,199,200;
...10000}

View 9 Replies


ADVERTISEMENT

Return Text From Left-hand Side Of Ragged Array Where Entry Found

Apr 11, 2012

I've been given a spreadsheet that is poorly constructed but I'm not allowed to alter.

The layout is:
Box Name Box Date ID1 ID2 ID3 ....
Where there is not a fixed number of IDs in each box
(There are five different sheets so I'll have some fun concatenating results)

Given a list of IDs I need to return the box name and box date that the ID's file sits in. The spreadsheet has blanks everywhere and the numbers contained in rows are non-consecutive and smaller values can appear later in a column than larger ones.

I think I need some combination of index, offset and maybe sumproduct? TBH, I avoid sumproducts like the plague, preferring to utilise sumifs and dynamic named ranges since this improves clarity so I'm basically a newb at them.

Any skeleton framework that you think would work to return the text values for the LHS where the number could be anywhere? Once I can see a rough example I should be able to get to grips with the logic and wrangle it into the necessary solution.

View 5 Replies View Related

Defining An Array To Use In For Next Loop

Feb 13, 2007

I have created some code of which this is an extract

Dim i As Variant

i = Array(37, 38, 41, 42)

For Each i In i

'Some Code
Next i

the routine works fine when the i variable is hard coded, but once the above is included it fails (Error 10 This array is fixed or temporarily locked).

View 3 Replies View Related

Days On Hand Calculation

Jan 29, 2009

I'm looking to create an inventory days on hand calculation (DOH), but I'm not quite
sure what formula will do the trick. Here is an example:


DOH......FG Inv......1/29/2009......1/30/2009......2/2/2009......2/3/2009......2/4/2009
X..........80.............20................20.................20..............20..............20


I'm trying to solve for 'X'. My finished good inventory (FG Inv) is 80pcs.
That will cover customer demand out to 2/3/2009. Therefore, I have 4 DOH
of inventory.

I'm looking for a formula to determine the 'DOH'.

View 9 Replies View Related

Inventory On Hand Calculations

Sep 22, 2009

I have a simple inventory spreadsheet that is doing everything I need minus one function. I have not been able to figure out how to make this work yet, maybe I can get some help. We remodel apartment complexes. I purchase material and hand it out to the contractors. I am using one page to track all movement of the items, but I have another page that I want to do that math and tell me what I should have on hand. Example: (On sheet1 "movement") I hand out 20 outlets. On my inventory on hand sheet I have a line that says "Outlet", the current quantity is 40. I have a drop down list so that on the Movement page I select "Outlet" in column A and in Column B I put in the quantity. I want to keep a running total on my IOHand page of everything, so that it would automatically subtract the 20 I just handed out and leave my IOH as 20. I have about 100 items on my IOH page. I assume I need a formula in the quantity cell of my IOH page that will search the Movement page and look for a match to what is in column A and Sum all of my "outlets" or "sinks" into the right cell.

View 7 Replies View Related

Set Formula On Right Hand Side Under Column?

May 5, 2014

I have created "front page" which allow user to enter their enquiry.

The formula will be as per below.

Issuing
World Bank -->if amount less then 500,000 = amount x 0.03125%; if amount from 500,000 - 2.5mil = amount x 0.015625%

Royal Bank -->amount x 0.0625% x no. of month (min charges 100)
Deutsche Bank -->0.025% per 3 months (min. S$50)

Stand By LC
World Bank -->0.02% per quarterly (3mths) - Amount X Rate X 1 (1 to 3mths) or X 2(4 to 6 mths) or X3 (7 to 9 mths) or X4 (10-12 mths)
Royal Bank -->0.25%p.a by day (Principal x Rate x Day divide by 360 day x 100)

Am I able to set a formula for example:-

1. When I click on Mode of payment - Issuing

2. On my right hand side under column "Bank Name" will list down all bank available

3. On my right hand side under column "Estimate cost" will auto calc the cost base on the bank's formula.

View 1 Replies View Related

Freeze Left-hand And Right-columns

Jan 7, 2010

Does anyone now if it's possible to freeze left and right hand columns simultaneously eg. cell C3 above and left AND cell DB3 above and right?

The columns on between would then scroll left or right, until the static column was reached?

View 14 Replies View Related

Days On Hand Against Forecast Table

Jul 12, 2012

I am having trouble finding the days on hand for each SKU. I am trying to get a formula to look at how many days will the total SKU Qty cover in the Forecast_qty. I used a vlookup to make sure the sku = sku but i cant get the days on hand number.

SKU
Total
DOH
ITEM_CODE
FORECAST_DT
FORECAST_QTY

596459
450
?
596459
7/11/2012
54

[Code] ............

View 1 Replies View Related

Hand Cursor For Control Commandbutton

Jan 22, 2008

I'm using commandbutton in a worksheet, and would like it to have the same cursor displayed as the 'forms' control.... for some reason, it remains an 'arrow' when the forms becomes a hand. I've identified the 'mousepointer' property, as well as the 'mouseicon' properties; however, it appears that for some reason, I don't have the hand-cursor icon on my system. (i've searched the hard disk, and apparently this is not entirely uncommon according to some posts I've found around the internet).

So my question/favor to ask is:
1) where can i find the standard windows xp system scheme "link select" hand-cursor
(control panel->mouse->mouse pointers... last one)

2) I believe its filename is "hand-l.cur"..... if anyone reading this post can quickly check their windowscursors directory for this file, and reply/ upload it

View 3 Replies View Related

Change Cursor To Hand On Control Mouse Over

Mar 3, 2008

I'm trying to get the cursor to turn to the hand (with the index finger pointing) when the user rolls over a label.

View 4 Replies View Related

If And - If Or Statements: Import ( On The Left) And Input By Hand To Get The Process Going

Dec 14, 2008

The questions are shown on the attached spreadsheet. There are 2 questions one on each sheet. On the spreadsheet the yellow cells indicate data that I'd import ( on the left) and input by hand to get the process going. The green cells have the correct numbers in them but I've had to manipulate them by hand.

View 5 Replies View Related

Excel 2010 :: Result Of Recorded Macro Is Different From Hand Work

Mar 10, 2014

I have csv file with tab delimited fields (see attached blacklist.csv). 3rd and 4th fields are in format dd/mm/yyyy hh24:mi:ss, some fields can be zero. I need to split data to columns and display datetime fields in format dd.mm.yyyy hh:mm:ss.

OK... open csv in Excel, select column A, press button "Split in columns", select tab as delimiter, choose date format (DMY) for 3rd and 4th field and press OK. Test is splitted into columns, now select columns C and D and select desired format "dd.mm.yyyy hh:mm:ss". Then I select columns A:E and set column widths to fit data in columns. This all is OK and without problems (see attached file Handmade.xlsx).

But now... Now I record all previous step into macro. There is macro text: [Code] ....

Now I copy macro text into clipboard and open blacklist.csv again. Insert button to list and bind it to new macro. Paste text of macro from clipboard. (See attached file blacklist_beforeClick.xlsm). Now click button Btn and voila... some dates remain in previous format, some dates seems to be in desired format, but day and month are swapped. Why are there differences when comparing data made by hand and data made by macro??? compare.jpg This is the same behavior in more computers, some use Czech version of Excel 2010, some use English version.

View 2 Replies View Related

Change The Color Box On The Left Hand Side See Attached Image

Mar 19, 2008

I have a form where I want to change the color box on the left hand side see attached image. Now it is a static and I want it dynamic where the user chooses the color. Now it is constant using an image with the color green, red, blue, etc... I want a color picker so user can pick their own colors and when the color is picked the code will pick the color number.

View 9 Replies View Related

Recognize Tiny Indent On The Left Hand Side Of A Cell

Jun 9, 2009

I'm working with text cells I get this tiny indent on the left hand side of a cell about the size of one hit of the spacebar button.

Excel doesn't recognise this as an indent and I can't get rid of it. It's, pardon my french

View 9 Replies View Related

Positioning A Specific Cell In The Upper Left-hand Corner

Jul 31, 2006

Is there a way (in VBA) to position a specific cell of a worksheet in the upper left-hand corner (i.e. cell H40)?? I have some code that I'd like to have do this.

View 3 Replies View Related

Move Pivot Table Total To Left Hand Side

Feb 8, 2008

Need a way to switch the default positioning of pivot table row totals? I would like to left justify them insead of always having the totals on the far right side where they are often out of view to the user without scrolling. I end up having to place 2 pivot tables side by side so that I can make the totals appear first.

View 3 Replies View Related

Find The Mode Of Each Months Data Without Typing It Out Into Long Hand Form

Jul 7, 2009

Attached is a copy of my data and i want to find the mode of each months data without typing it out into long hand form, eg. 111122222333344444 etc. so i believe the answer will be some where around 5 for most of them, but i just don't know a formular to show it automatically on the spread sheet.

View 2 Replies View Related

Defining Name Over 255 Characters?

Feb 17, 2014

I'm trying to make a chart viewer on the first sheet of my spreadsheet and am using this website as a guideline, [URL] However instead of the 3 charts in the example, I have 12 which makes my formula for defining a name substantially longer.

By moving my charts to the same sheet and getting rid of the INDIRECT formulas, I shortened my formula to 291 characters which is too long as the limit is 255.

=IF($G$9="Sodium",$N$34,IF($G$9="Manganese",$N$35,IF($G$9="Iron",$N$36,IF($G$9="Nitrate Nitrite",$N$37,IF($G$9="Nitrite",$N$38,IF($G$9="Nitrate",$N$39,IF($G$9="PH",$N$40,
IF($G$9="Conductivity",$N$41,IF($G$9="Turbidity",$N$42,IF($G$9="Fluoride",$N$43,IF($G$9="Selenium",$N$44,$N$45)))))))))))

Is there any way to make my formula shorter? Or to reference a cell where I place the formula?

View 5 Replies View Related

Defining A Minimum Value

Oct 7, 2008

If Average GMV (Cell A1) is less than 75% of Average BP (Cell B1), use Average GMV, however the Average GMV or Average BP can't be less than $600 million. Multiply the result by .01*1/3. Below are two equations I've created, however each of them only solves one part of the problem.

=IF(A1<0.75*B1,A1*0.01*1/3,B1*0.01*1/3)

=IF(B1<600000000,(600000000)*0.01*1/3,B1*0.01*1/3)

Essentially Average BP would be used, unless Average BP was something like $900,000,000 and Average GMV was around $650,000,000. At this point Average GMV is 72% of Average BP and above the $600,000,000 minimum.

View 2 Replies View Related

Defining Names

Jun 16, 2009

Knowing Excel adapts its formulas upon inserting a row (i.e. a sum formula will automatically include a new row inserted in the middle of its range). Is it possible to do this with a named range. I have a pivot table that serves as a table for a vlookup, but the table sometimes changes month to month with extra accounts. I need to be able to keep the formula even though the table changes, so I figured a named range would help me out but it still doesn't accomplish what I need it to do. So basically, is there a way to make the Named Range, say AGroup (A1:C5) extend to (A1:C7) if 2 new rows are added in?

View 12 Replies View Related

Defining The Right Chart Among Several In A VBA-script

Apr 23, 2009

I have a sheet containing several charts. I have a script which I found on this site that helps me create dynamic min and max values for the axis.

Since I have several charts it seems that I need to define which chart that I want to change the axis.
This causes an error.

View 9 Replies View Related

Defining The Next Non Blank Column

Aug 7, 2009

I have a form in excel that people are going to populate, then a button which runs a macro which copies all the cells out into a new line in a different worksheet inside the spreadsheet. im going to use that sheet to formulate graphs etc, the macro works however it overwrites previous data, im assuming i need some function to calculate which is the next empty cell then use this to to copy the data to

View 12 Replies View Related

IF Formula - Defining And Range

Jan 22, 2010

I would appreciate knowing how to fix this formula to do more than less than/more than answers. How do I have the following answers return for these birth year ranges? I have attached a sample file, with the formula in place. Thank you so much for any help!

1974-1991 = amateur 18-35
1900-1973 = amateur 36 and up
1992-1994 = junior 15-17
1995-2005 = junior 14 and under

blanks or zeros = unknown

View 8 Replies View Related

Defining Columns In A Sheet

May 21, 2014

I am starting to write a macro and first thing i Need to define is all the columns that I need in my report. I started out by defining an array and this is what I have so far.

I need that every time I run this macro it should vlookup the data from cleantxt files that are saved in my c:autofile ReportsFC Banded Summary and essentially create separate excel files for different buyer names and save those sheets to my C:Banded Summaries with the name as Bandedsummary(todays Date)_BuyerName

This is going to be the bones of it then I have to figure out how to vlookup data for all the columns and do sumifs and format it.

This is what I have so far:
Function IsInArray(stringToBeFound As String, arr As Variant) As Boolean
IsInArray = (UBound(Filter(arr, stringToBeFound)) > -1)

[Code]....

View 4 Replies View Related

Defining Cell Name When Dynamic?

Nov 6, 2008

Defining Cell Name when Dynamic?. Here is whare I am.

View 3 Replies View Related

Defining A Variable As New Collection

Dec 7, 2008

I have a piece of code I am using to important data from a text file. The code works fine but I am having a hard time understanding how defining a Variable "As New Collection" works. I have tried to research on numerous websites dedicated to excel but had no luck finding any further information.

I have executed the code line-by-line over-and-over and believe what the "new collection" does is it creates some type of external database that is hidden within excel (that's just my guess). I have attached a sample file and a text file with dummy data if needed to see how the code is working.

View 4 Replies View Related

For Loop Object Defining

Jan 20, 2009

I tried to run this code and encountered an error telling me that N should be an object.

N has to be a variable number representing the amount of sheets in the workbook -2.

Does anyone know how this is written?

View 6 Replies View Related

Defining 1 Of 3 Possible Print Areas

Dec 5, 2009

I've got a spreadsheet that could have 1 of 3 possible print ranges:
PR1 = B2:K67
PR2 = B2:K132
PR3 = B2:K197

If there is a value greater than "0" in Cell B68, the print area would be PR2, but if there is a value greater than "0" in Cell B133, the print area would be PR3, otherwise it would be PR1.

These print ranges are such that the page break would would be below B67 and B132, but I'm concerned that I may need to set these page breaks in the Macro.

I'm not sure how to use the IF, THEN, ELSE, in the Macro to test the value of the cell and then set the print area.

View 3 Replies View Related

Defining Dynamic Ranges

Oct 6, 2008

I'm trying to make ranges in a SumProduct formula dynamic, but getting errors #N/A. I think this is because the top two rows are headers, throwing off the range count.

Q. How do I adjust the range definition to compensate., e.g.

Range =Offset(Sheet1!$D$3,0,0,COUNT(Sheet1!$D:$D),1) where column D is numeric, and

Range = Offset(Sheet1!$T$3,0,0,Match("*",Sheet1!$T:$T,-1),1) where column T is text?

I had assumed that the offset value 3 would do this, but I suspect the functions count and match are not doing so.

View 8 Replies View Related

Defining A Boolean Without It Having An Actual Value

Aug 23, 2007

once bTest is declared as a Boolean, it becomes equal to FALSE (I checked this after much head scratching). How does one assign a value to a boolean variable only after you make your test.

Sub foo()

Dim bTest As Boolean

If Range("a20").Value = False Then bTest = False '

View 9 Replies View Related







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