I want to store a list of strings in an array with their position so that I can sort them alphabetically and then be able to put them back in their original order again e.g.
John 1
Charlie 2
Paul 3
Andy 4
etc,
So when they are alphabetized (is that a word?) they become
Andy 4
Charlie 2
John 1
Paul 3
My plan was to store them in an array, but I can't think how to do it. In python, I would just make a list of tuples, what is the best way to do this in VBA?
I'm not sure if it's possible to do this, but I have three lists of data. One is a complete list (for example, the numbers 1-25). The next list is a subset of the complete list (e.g., 1,3,5,7,9). Attached to these (the subset list) is another list (let's say letters, so A goes with 1, B goes with 3, etc). I want to physically move the paired entries from Lists 2 & 3 so that List 2 matches up with List
I need to complete what would seem a fairly simple incrementing task but I'm not getting the results that I'm looking for. I don't know much about macros so would prefer not having to use one but I'm willing to try if it's not too complicated.
I'm using Excel 2010 on a PC. For several projects, I need to increment cells that contain text and numbers. The column contains data in a cell (A1), followed by a blank cell (A2), then cell A3 contains new data followed by a blank in A4, etc. What I need to do is 1) copy the exact data in A1 to A2 and then 2) increment the number used in A1/A2 by 1 in A3, copy that into A4, and the pattern repeats down the column.
Here is an example of what I have in column A: Test_01 [blank cell] Test_02 [blank cell] Test_03 [blank cell] etc.
This is what I want as a result. Test_01 Test_01 Test_02 Test_02 Test_03 Test_03 etc.
Do I need to save the data in the column as text, general, or numbers? Is there some function that would make incrementing the data possible as I've outlined above?
Is there any way to find pairs of numbers from lotto data ,starting from the highest to the lowest for the full 24 pairs? It does not matter if excel formula or Vb code.T
I've got 3 pairs of columns and I need to sort through them and align the cells in columns E&F with those in A&B and C&D. The cells I need to match up are the times (columns A, C and E)
- I have total of 13 sheets in a workbook - 12 sheets represent 12 months with data; 13th sheet is single sheet in which i would like to get complete overview of 12 months
- each of 12 sheets has actually sales results for multiple products with following data: internal code, manufacturer part number, name, and qty sold in that month
- situation is that some products have been phased out during the year and some were introduced so each sheet is slightly different in terms of in which row certain product is located
What i would like to achive is to make 13th sheet (whole year overview) do the following: - there is a list of all the products in it, each product has unique internal code - this code (from each line) should be used to find that code in each monthly sheet, then find its monthly sales value (copy it) and paste it in sheet 13 in cell that represents this product and particular month.
In other words i would like to see for each product what was monthly sales throughout this year, but avoid manually filling in qty for each product per month.
Currently We enclosed a Workbook (with exiting VBA code) In this workbook 3 sheet exit (Edit, Details, Summary)
In Details Sheet store Detail Entry of Invoice & in Summary Sheet we store all generated Invoice details in summary form
We want new VBA or correction in existing VBA.
My Exiting VBA work following..
When Enter Invoice Number in Edit Sheet (Cell B2) then Display Entered Invoice Data
First Code Find Invoice Number in Summery Sheet if Invoice Number found then Record Display of Selected Invoice
Here we Edit As per our requirement then We Press Y in Edit Sheet Cell C30
If Found C30 "Y" & "Data ok" in E30 then DELETE Selected Invoice Data From SUMMERY & DETAILS SHEETS & COPY THIS EDITED DATA (RANGE A33 TO G33 In Summery Sheet & Range A35 to A60 in Details Sheet)
My Exiting code work perfectly as per above
We want only following thing
Currently when we copy edited data that move to end of sheet We want to Change & same place where data exit previously before edited. Because serial number disturb.
NOTE : in Editing Time is it possible Few Item Delete or Few Item Add
I have a two rows of data one containing names and the other containing corresponding numbers. The names are static and the numbers change on a daily basis. I want to be able to copy the numbers to a static table next to each name on a daily basis (so I can see what the value was a few weeks ago).
Is there anything I can write to do this job?
My thinking was to set a vlookup to grab the data but i'm not sure how this would work because the vlookup would change daily when the numbers change
Is there a Function or Formula that can store data from say cell $J$21 and store the result in L21 in the same worksheet and every time the data in $J$21 changes the result moves down 1 ie: L22 etc.
I am trying to do is use a loop to store data from a range into a 3 or 4 dimensional Array and then output the data from the Array in another range. so for example the i want loop through the data in this range and store all data that is in account 701 into an array and then output this information in another range (tab). The data would have several different account but I only want to see one at a time.
I have the master data in sheet 1 with the some details of different stores eg store 1, store2, store3 etc which are in Column D.
I need to filter the data by each store and paste in the new sheet. If i use advance filter>copy to another location, the system is not allowing to select different sheet.
is ther any way that If I run the macro, the data is filterd by Store names and the same data should be pasted in a different sheet with the store name. that is all the data related to Store1 should be pasted in Store1 Sheet.
I would like to know if its possible to extract just the even/odd pairs from a number.
Exp. I have the number 123 in cell A1, and would like to extract the even/odd pair, which in this case would be 13, the cell A2. I would like to be able to do this without the use of "Isodd" or "iseven" functions.
I am looking for a code which will check and display the Maximum Occurrences of pairs of 2 Characters.
In the attached file I tried to write some code but it seems to be wrong.
For your convinience, I entered the reuslts in a table (hopefully not mistaken). The code should display a MsgBox saying that "The pair 'ab' was found 6 times in A1.
The string, in A1, can be any string in any length.
I am trying to analyse a set of variables in my dataset.
The variables I have are numbers which are organised into a single column.
I want to count the number of times different variable pairings occur within my data.
An example dataset of mine is: 1,2,4,2,1,3,5,3,2,1
As the dataset contains 5 variables (1,2,3,4,5) the potential combinations are: 1,1; 1,2; 1,3; 2,1; etc.. with 25 in total.
I want Excel to move through this column starting with the first two cells and step down 1 cell each time and then tell me the number of times each of the combination occurs.
I have a database with 6 columns in play (there are actually other columns but they are not relevant). I'll call the columns A through F. I would like to be able to match certain counterpart rows together, do a sort placing the counterpart rows adjacent to one another, and then count how many pairs I have. (Some rows will have no counterparts.)
I basically need to devise a formula or script that pairs together two rows that fit the following criteria:
1) The rows are identical in Columns B, C, D, and E. 2) The rows are not identical in Column F (i.e., one half of the pair should have "yes" and the other half should have "no") 3) The rows are as close together as possible according to the date sequence in Column A. For example, Row 1 should pair with Row 6, and Row 5 should pair with Row 7. Row 1 should not pair with Row 7, and Row 5 should not pair with Row 6. **This criterion seems tricky because R5 and R6 would technically fit the requirement for pairing, were it not for the fact that R1 comes earlier in the sequence.**
I have a map with several waypoints and would like to find the distance between any of these two waypoints. Sounds simple, but I have having an issue with the later parts of the excel file. Let me explain further.
There are over 100 waypoints on this map we have. Each waypoint has an, seemingly arbitrary, X-coordinate and Y-Coordinate. However, if you divide the coordinates by [X], they turn into miles. It should go without saying that finding the distance between two waypoints is rather simple mathematically, but I having an issue figuring out how to pull two random waypoints and having the distance automatically calculated.
So far, I just have column A with the waypoint name and with column B and C having the X and Y coordinates respectively. Is there anyway I can create some sort of call function that when two waypoint values are entered it would automatically calculate the distances?
How do I express the following as a formula for range f2:h2:
case 1 if any number is equal to 0 or 5, then 1 if any number is equal to 1 or 6, then 2 if any number is equal to 2 or 7, then 3 if any number is equal to 3 or 8, then 4 if any number is equal to 4 or 9, then 5
I need to pair up 20 people in sequence for a workshop, so I number the people and can rotate people numbered 1-10 with 11-20 easy enough, but when it gets to pairing 1-10 together in pairs and 11-20 in pairs.
Is there a formula I could use in Excel to work out the easiest pairing for me?
I have a string of n pairs and want to check various combination of that string. Example: Pairs 58 78 15 Since I know I have 3 pairs (but it can be 2 or 4), I know the number of combination I want to test, ie 2 power 3 = 8 combinations. How can I program a code creating the various strings, ie 587815, 587851, 588715, 588751, 857815, 857851, 858715, 858751 ?
This is what I have so far (not much):
Public unique_pair 'number of pairs provided by another macro Public mystring 'provided by another macro Sub make_guess()
Dim number_of_combination, i number_of_combination = 0
number_of_combination = 2 ^ unique_pair For k = 1 To number_of_combination
I have a spreadsheet with 14, or maybe 16, or maybe 40 names in column B.
A1 = 1 B1 = JOE CITIZEN A2 = 2 B2 = JANE PERSON ... A17 = 3 B17 = JACK DOE
and so on...
I want to randomly assign these names to pairs using a macro button, and basing it on the number of players (C1)
So if C1 is 12, I'd like the function behind the macro button to come up with 6 * 2 numbers (2 and 11, or 4 and 7,
all completely random, but within the 12 specified in C1) and write these random values in Range D1:E6 (if C1 is 18, then the range to write in would expand to D1:E9).
I don't know enough about writing code to be able to pull this off .
I have created a table that has working hours of staff members over many weeks. Week number as column headings (1 to 52) and staff name as Row headings. E.g a row may be
John Smith, 37, 37, 37, 37, 64 (commas to show seperate cells)
How would I go about using conditional formatting so that the formatting changes according to the sum of the values in each pair of cells?
I need to add the total hours of every two weeks for some staff and change the fill colour of both cells accordingly to highlight which weeks staff have worked too many/few hours.
So (B1+C1) would be a pair, the total would decide which fill colour is used on both B1 and C1, and then (D1+E1) would be the next pair and so on.
I have tried using 'a formula to determine which cells to format' and placing =(B1 + C1) = 74 and making it fill the cells green but this appears to be doing (B1+C1) as the first pair and then (C1+D1) as the second and changing the format for the first cell only.
I've managed to get my macro to work ok - but what I want to do now is to get it to loop through more columns. Currently it looks for email addresses in column AH (which will always be the same) then it looks for a "yes" in columnAB and if there is no "SENT" in column T then it sends an email,after which it adds the word "SENT" to column T. What I want t do is for the macro to then run on columns AC+U, AD+V, AE+W and AF+X. So basically it will loop through one column to the right each time for a total of 5 pairs of columns
So I have a spreadsheet that has a Title in Cell A1, then entries in B1, D1, F1, H1, J1, etc... with empty cells between.
What I would like to do is copy those entries to the right, i.e. B1 into C1, D1 into E1, F1 into H1, but all the way along because in my master sheet there are a lot of columns.
I have one hundred rows of data and within that there are some records which are the same and they will always be in pairs - identifiable by a cell with the same ref common to both records. how to strip out the records that are not part of a pair? I would like remove all of the non pairs and move them to another sheet.