i have a matrix and want find min & max this matrix. know must use For and IF for example for MIN: i want "a" compare "b" and if "a" < "b" then "a" is local optimum else b is local optimum then "c" compare "a" if "a" < "c" then "a" is local optimum else c replace a and c is local optimum &... until find Global Min
but i could not coding this in VBA EXCEL!!
i do not know number of my columns user will define it so for example i can't use Range("A1")
My problem became greater because at start user will define a number for every column(1 or 2)
and if column value was 1 for example find Max column and put it in cell(1000,1000) then find min column and put it in cell(1001,1000) else i.e if column value was 2 find min column and put it in cell(1000,1000) then find Max column and put it in cell(1001,1000)
and column value for column1 equal "1" and for column 2 equal "2"
so for column1 in cell(1000,1000) will write "16" and in cell(1001,1000) will write "12"
but in column2 because column value equal 2 will have: in cell(1000,1000)= 2 and in cell(1001,1000)=10
Attempting to hide columns (of cities) via VBA generates an error when that same city is reselected (either individually, or as part of the group) in the list box, upon clicking the 'Hide' button.
I have 6 columns containing Agency IDs of different years. I would like to know which agencies appear in all the years. That is which agencies were funded for all the years. How can I do this? perhaps Vlookup?
I have two lists of email addresses in columns and I need to find the matches between columns and have those addresses returned to perhaps a third column.
I have a number in column “A” and I want to match them with column “D“, the number in column “C” and “D” is true value. find attached sample sheet for more detail.
FROM: /// TO: /// Value 0 /// 25,000 /// x 25,001 /// 50,000 /// y 50,001 /// 75,000 /// z
etc etc.
I then have another table ( 2 columns) with the first column being inputed values from another worksheet. This inputted number will fall between one of the ranges. The second column needs to have the appropriate VALUE from the above, 3 column table.
How do I go about making a Vlookup that can find ranges between 2 columns? So if I have a value of 30,000, it will return "y".
I have Dates as column headings, People going down across rows, and their corresponding budgeted hours:
Person Last Day 1/1 1/8 1/15 Bob ? 45 45 0 John ? 45 0 0
I need a formula in the "Last Day" column that can pick up when a person rolls off the project, i.e. has a value of "0" or "-".
I need this because I have a spreadsheet with thousands of resources and don't want to comb through, manually looking for their last day on the project.
I have records on columns A and B. I need to find the matches between the two columns and insert it into column C. My sample only shows a few. But my actual data has hundreds of records.
I have a fairly large timecourse dataset and I need to find all common values within all 3 columns. Also, when I find these 'common values' is there a speedy way to retrieve data in the same row that is associated with these values, instead of going back one-by-one and copying and pasting beside the value that the function has returned?
Here is the problem: A1 contains : current model numbers, B and C contain new model numbers and corresponding old part numbers. Based on Column B and C I need it to go through and find all the old part numbers in column A and reaplce it with the new part numbers: Here is my table:
Current # NEW AFS# current # 10773650204020000216802606 10773652204022000116035305 10773653204023000115744805 10773654204023000215744806 10773657204023001215744881 10773658204023022715744844 10773659204024000115836205
For example, I need it to find all instances of "10773650" (first data in column A) and look in column C to find the corresponding number if it exists, if it does exist I need it to be replaced by the corresponding data in column B
I work at a club. I've got a spreadsheet sent to me from another club we do business with. On it are charges from their club to ours that list the charge and associated member number.
I'm trying to use the text to columns feature to separate the member number from the other data in the column so I can sort by member number making it easier for us to bill our members.
Here is a sample of the data:
"Beach Club Bar,b500" "Beach Club Bar,s200" "Beach Club Bar,a150"
When I try to use text to columns what happens using the comma as a deliminator, everything including and after the comma disappears.
Thinking that maybe I needed a space between the comma and the member number (in the first line b500 is the member number) I tried to use find and replace to replace , with , and a space after it. This also resulted in all of the data including and after the comma disappearing. I'm sure I'm missing something here.
I tried copying the data into a separate spreadsheet. Tried changing it to text or general.
I typed in the exact data as you see it and tried the text to column function and it worked perfectly. What could be hidden in the data in that column that's causing this?
I want to loop through ID Column and find the matching number in Record No.column, and hightlight the entire row when match is found. The code I am running can only work for one cell at a time, but I want to run one time.
I have been put together some simple coding to find and replace a value (1) that i have obtained from a pivot table. My aim was to replace any "1" with the column header. The reason for this is that the cell(s) will be used in a VLookup at a late stage.
My problem is that I have the code to work for a single cell, but I want it to work for multiple columns so I don not have to create multiple macros.
I need to go from Column C to AW. I have a total row at the end - hence why I am using 'Step - 1'.
Code: Sub FindReplace() Dim i, lRow Application.Calculation = xlCalculationManual
I am writing a macro that will find several different values in sheet1 and replace them with values from a table in sheet2. It currently does exactly that but I realized that there are instances when replacing hyphens isn't appropriate and will ruin the upload of my data. I need to replace it in the rest of the columns though. The headers will always be the same, such as "MST" , so I could use that as a conditional statement I just don't know how to go about it with the replace function.
Code: Sub FindAndReplace() Dim LastRow As Integer Dim i As Integer 'Counter to loop through all the rows found in the table
'Finds the last row used in my replacement table and sets that as the searchable range
I have this code to look into the "find" match in Column A, and then search to the right for the next columns empty cell and update data. but it seem like the code can only manage to offset 1 and update data to Col B, instead of find the next empty cell to update data.
Code:
Dim vFind1 As String, vFind2 As String, rFound As RangeDim bFound As Boolean vFind1 = Me.CBSupplier.Value vFind2 = Me.CBProducts1.Value Set rFound = Sheets("Main").Range("A:A").Find(Me.CBSupplier.Value, LookIn:=xlValues)
I'm looking to loop through a worksheet with over 1000 columns and would like to delete columns containing a percent sign (%) in the header row which is row 4. Column range to search would begin at column 12.
I have a workbook with two sheets, and I am having difficulty in finding how to match up the data.
Sheet 1 (named "TS") consists of several columns, but it's always a series of date columns followed by multiple site numbers.
Sheet 2 (named "Dates") consists of just two columns, a site ID and a Date column.
I am having difficulty in finding how to lookup/match the date that goes with the store number, as the information in Sheet 1 (TS) is laid out in a horizontal fashion.
So, for example: Sites: 14352, 14425, 11661, 404, 8142, 3571 should all have the date of 5/17/2014.
As such, on Sheet 2 (Dates), whenever those site IDs are encountered, the date of 5/17/2014 would need to be applied in col B.
Similarly, on Sheet 2 (Dates), for site IDs 1201, 3613, 9316, 9735, 13211, 7640, the date of 6/21/2014 would need to be applied in col B.
Here is a link to a sample workbook: [URL] ........
I would like to find the last row in my sheet containing any data in the columns A:O and select the cells in the range of A:O to that last row. I would then like the code to name this selected range as IMPORT.
I need to find out common numbers between columns. Each column has multiple number entries seperated by a comma. For example:
Column A: "5592,12222" and Column B: "1,2,3,4,5592,123123" and Column C: "3, 4"
I need to find out any numbers that are found in more than 1 column. Hence, the result should be something like "3,4,5592". If no match is found then maybe can indicate by coloring the cell. My data is over 50,000 rows and 30 columns. I need to do this for each row one by one.