I have a given length of steel bar...Example(550 feet)
I have various cut lengths that I can pick from...
14'-10".....13'- 9".. 12'-8"........(up to 6 different lengths)
I need to know the best combination of lengths to cut the long bar into to have minimal scrap left when we get to the end of the 550 feet.....
Cut as many of the longest cut lengths possiable.....Cut as few of the shortest cut lengths possiable
Due to the fact that I will have to convert this to a PLC application when completed, I want to find a mathmatical way to do this inside excel and not use the "solver"....Assuming that I/we can come up with an equation to do this .....
I have a rather large spreadsheet that takes a very long time to calculate once the new data is added. One of the many things I need to do is look to see if a unique value in range 1 is also in range 2. If it is, return some data (vlookup), if it's not, then I want a "0", not #NA. My question is, which of these two methods will result in a faster calculation (if at all):
Option 1: Do it in one step =IF(ISNA(VLOOKUP($A3,LY,3,FALSE)),0,VLOOKUP($A3,LY,3,FALSE))
Or option 2: Do it in two steps: Column N formula: =VLOOKUP($A3,LY,3,FALSE)
Column N+1 formula: =IF(ISNA(Column N value),0,=column N value)
I have many columns of data using formulas in option 1, so if I have coded this badly that could be my problem...
This macro accepts analytical files of constant format, imported into individual worksheets. Each file contains header information, followed by bulk analyses. Header information is extracted and used to tag individual records within an array. A unique header is created for each analytical method and erroneous values are treated. The array is output to a new worksheet, then the macro loops, repopulates the array, attempts to match the headers of the current array with those in the output worksheet and writes records in the corresponding column.
I'm particularly concerned with the section entitled "Match columns to headers" as this involves several nested loops and seems very inefficient.
As it goes, it works. However, as I intend to develop the macro further into something more versatile, it seems sensible to get the fundamentals correct.
Sub Format_Assays()
Dim batchId As String, inArray() As Variant, i As Integer, j As Integer, outRow As Integer, outCol As Integer, outSheet As Worksheet, sExist As Boolean, wSheet As Worksheet, x As Integer, xout As Integer, y As Integer, yout As Integer
'Cycle through required sheets For Each wSheet In ActiveWorkbook.Sheets If wSheet. Name = "Assays_All" Then sExist = True Exit For End If Next wSheet
I have a spreadsheet with 10,000 rows. In column A dates are mentioned and in column B I'd like to calculate the specific Quarter via VBA code as I can't have formula's in my sheet. My VBA code is:
Sub QuarterCalc() Dim myCell As Range Application. ScreenUpdating = False For Each myCell In ThisWorkbook.Sheets("Data").Range(Cells(1, 2), Cells(10000, 2)) myCell.Formula = "=INT((MONTH(RC[-1])-1)/3)+1" myCell.Offset(0, 0) = myCell.Offset(0, 0).Value Next Application.ScreenUpdating = True End Sub
Im setting up a spreadsheet that does engineering calculations. Im using macros to run sizes from a standard schedule. It basically takes the values from one sheet (schedule) to another (calculation), then the result from the calculation sheet (Value only, not the link) is pasted back into the schedule. The macro seems very bulky and im sure that it can be made more efficient with a loop. here is a sample of the code from the macro;
I am having a little trouble with this code, which runs in my simple but efective ressource overview. It loops through a rather large range and assigns interior colour to the cells based on certain criteria. On my stationary machine (Excel 2003) it takes approximately 15-30 seconds to run the code which is acceptable. On my laptop (Excel 2007) it takes 5+ minutes which is unacceptable. Is there a workaround so as to optimize the speed? Further, when I run this workbook on Excel 2007, even entering an integer in the sheet takes 3-4 seconds, and no code is running! In my first version I used a Change_Event to colour cells on the fly but this was slow and prevented multible cell editing as well as pasting values into the appropriate range.
Public Sub Farvelade() Dim icolor, Navn As Integer Dim TargetRow, LastRow, Previous As Long Dim Target As Range MsgBox "Det kan tage 15-30 sekunder at opdatere ressourcekalenderen" Range("A5").Activate Range("A5"). CurrentRegion.Select 'Set range ActiveCell.Offset(Selection.Rows.Count, 0).Activate LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row.....................
I have two worksheets. ws1 contains a large number of dates on column 3. ws3 contains around 20 dates on column 3.
I want to pick two dates randomly in ws1 that does not already exist in ws3.
Here is my working code, but it is really slow to process. How to optimize this code? Also I would like to add a function where if the macro is not able to find two random dates that aren't already in ws3 then exit loop.
VB: Set ws1 = thisworkbook.sheets(1) Set ws3 = thisworkbook.sheets(3)
lr = ws2.Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row Set rvis = ws2.Range("c2:c" & lr).SpecialCells(xlCellTypeVisible) mynodate = 0
I have 4 lengths in four columns in a random order, and need to compare them to see whether they are equal lengths.
I Have figured out how to order them so I can compare them, but can't think of a formula to show whether they are equivilent (eg 1000m = 1km) True or False outcome is fine.
I have three columns, one column is time every two seconds with data associated that time, and one is time every minute with an associated tidal height.
I want to sort my data so that for every 2 seconds I have an associated tidal height for that minute.
eg: what I have: Time Time Tidal Height (2 sec intervals) (min) (meters) 1:15:00 1:15 1.342 1:15:02 1:16 1.221 1:15:04 1:17 1.115 ... 1:15:58 1:43 0.024 1:15:60 1:44 0.012 1:16:00 1:45 0.008 ....................
I have a performance extract from a system which has performance for multiple accounts but the data is off different lengths and shown vertically. I wish to move the data onto a new sheet but rotated(transposed) horizontally
Attached is a snapshot of the report that is usually about 20,000 lines. See input and output tabs.
Is there any way that a macro could be created to do this.
10015200 US Government Bonds 18,369,423.52 10012301 US Government Bonds 10,232.21
There are many varying lengths of digits. I am trying split off the numbers to the right of US Government Bonds into another column. Here is my formula: =RIGHT(A7,IF(ISERROR(FIND(" ",A7)),LEN(A7),FIND(" ",A7)))
My result is 9,423.52. Its not pulling the whole number.
I have used ROW function to determine the facets lengths and the number of internal angles and also the radius's the offset figure is the distance the track or pole is set from the frame this can be adjustable by us or the end user
the radius measurement is a minimum and a maximum that the aluminium can be bent, will probably be set parametrs to work with
Now bay widows come in all sorts of shapes and sizes 90 degree angle bays 2 bend bays 3 bend bays this is why I am using the row function, once the measurments are entered can excel generate
I have attached an excel file. What I would like to find is the average of column D (number) with respect to column A (Genotype ) and also different wave length (Column C). i.e.:
Genotype 1 to its corresponding value in column D for wave length 450 Genotype 1 to its corresponding value in column D and for Wave length 470 to and so on.
I'm trying to compare two columns of names that are different lengths. I need a formula that will return the differences. I've tried everything my nonanyltical mind can think of
I am trying to do a VLOOKUP using a list based on our Part numbers in Excel 2007. When I do a normal sort it groups the numbers 1 thru 9 by the number of digits, giving me multiple list of 1 thru 9. When I do my lookup it will not find the shorter numbers. Is there some way to sort these Part numbers in order regardless of the number of digits?
I am half way through writing a bigger macro, but am stuck at this stage.
I need to copy from a block of data as shown:
However, this column varies in length each time, and I only want to copy down to where the entries stop.
I also only want to copy W1:X6, and columns Y, AA, AB, AD (but only down to the end of the column)
I've tried using the End(xlDown)).Copy function, but obviously this doesn't work with the block up the top and the gap between the block and the columns
I have a column of data that contains suburb, state and postcode (zip code). I can extract the postcode quite easily using:
=RIGHT(H2,4) However, sometimes there is one word for the suburb, and other times there are two or more words. Also, the state abbreviation contains either two or three letters: MARYBOROUGH QLD 4650 BRAY PARK QLD 4500 TEA TREE GULLY SA 5091 Does anyone know of any code I could use to extract the three pieces of information into three new columns? (I.e. Suburb, State, Postcode)
I imagine the formula would contain some method of counting the number of paces; however, the number of spaces between each word may be more than one space.
need to autofill collum C with a formula related do collum B. If I do this by hand I just type the formula in C 1, and click on the right-down corner of the cell selection, and the formula goes until the last line (last value on collum B). But I want to create a macro to this function, and the problem is that the files that I will apply the macro have different lengths. I want to modify the macro to be able to run from C1 until the end of the values on collum B. I don't want to freeze the last value.
In other files C4819 will not be the last value, could be 5345 for example, but its impossible to do this, my macro should do: "autofill collum C with a formula until the last value on collum B"
I need to copy cells M6 to S6 down to all rows in a worksheet. The columns will remain M to S. The number of rows however vary in each worksheet.
How do I get the macro to read "End Down" with varying number of rows. I will need to do other functions also using "End Down" so if possible is there a generic code for this.
I paste in information in Columns A-E with varying lengths for each report that I need to generate (They generally range anywhere from 10-500 rows). I have formulas already in place in the first row of Columns F-L that need to be copied down as far as columns A-E go. I recorded a macro for this when I try to run the macro for another report with more or less row entries it copies down as far as the original recording was set. How do I make it so the rows will copy down just as many as I need and not some arbitrary number of rows? This is my first post so if any clarification is needed that's no problem.
Goal: To extract the barcode (numbers and letters between B/C: and , P/G) from the following string:
"Codec B/C: A01234567, P/G: 123456728912345" Current Function: =MID(A1,(FIND("B/C:",A1)+5),(FIND("P/G:",A1)-14))
Problem: I need this function to work for barcodes of varying lengths. For example, in some cases the barcode may be 8 characters long and at other times the barcode will be 14 characters long etc.Below is a screenshot of how I have this currently set up in excel.
VB recorder in Excel. The macro is designed to process a spreadsheet that will have the same number of columns and same type of data in each column, process this data with a formula (hat tip: AlKey+XOR LX) and then clean up the columns ready for use in another program.
I have got it working but when I alter the row length the macro only works to the final row in the recording spreadsheet. I realize this is because when recorded the macro I told VB to set the range to a given row.
I remember there is a way of setting the Range function that tells VB to always go to the bottom of the rows filled with data but I can't find it for the life of me.
Assume there's an even number of rows containing textual data.
COL A text1 text2 text3 text4
I would like to compare the lengths of text1 to text2, and return the row containing the greater of the two/delete the row containing the shorter of the two. In either case, the contents below would then have to be shifted up by one. Then repeat for the next 2 rows all the way down to the last row using VBA.
I've got a Listbox in a User form that looks at data on another spreadsheet purely for informational purposes, not to be selected. I have two problems with what it's doing:
1) There are 23 columns, of varying widths. However the listbox uses a standard width, so some items are truncated and some have too much room.
2) The data changes, and the number of rows may change from 2 to 15000. I've set the RowSource to cover the ranged from A1:W15000, but if only 2-300 lines are selected the user can't grab the scrollbar button to scroll through, but must instead use the arrow, which is rather slow.
Is there any way to set the column widths to match the data, and the Range to only go as far as the last populated row?
if you look in Column G you will notice the number on the right side of the column is indented one space too many (for any number that is 6 long in column A).
Is there any way to do an IF C=6 and then have it remove a space from before the number in Column G to have it line up?
I am working on this report for data from 2007 to 2011 for multiple customers. I have two columns of data for each customer for each year. My ultimate goal is to get a total for both columns of data and insert it in the row right under the row containing the last year of data. Below is a sample of what my data looks like and what I want it to look like. Here is the data:
I have figured out certain formulas that can get me pieces of the text substring, I am having difficulty finding an all in one solution that will allow me to run a macro and automate this process due to the nature of variability of the # of characters in the text string. The category and what I need to extract is as follows (Michigan Missing Zips roll up I can deal with):