Insert Values To Multiple Cells At Once
Jan 18, 2008
I am writing a simple VB app to allow my analysts to export data from a SQL table into an Excel spreadsheet. I have the following
lngRow = lngRow + 1
Do While Not rs.EOF
lngCol = 1
For Each objField In rs.Fields
objExcel.Cells(lngRow, lngCol).NumberFormat = "@"
objExcel.Cells(lngRow, lngCol).Value = objField.Value
lngCol = lngCol + 1
Next
rs.MoveNext
lngRow = lngRow + 1
Loop
The code works perfect... except... it takes far too long (as one would expect from iterating through 11,000 records cell by cell)
Is it possible to set the values for an entire row with one statement (or even better, the whole sheet at once), like maybe I have a string that is tab delimited or something
View 9 Replies
ADVERTISEMENT
Sep 25, 2013
I've a set of 10-digit numbers within a cell, which need to custom formatted in a particular format.
i.e., '1234567890' should be custom formatted to '123-456-7890' (for this i'm using the custom format 000-000-0000)
However, when I have multiple 10-digit numbers like shown in the trix (click here), i'm not able to format them because they are all comma-separated.
Do LMK if there is a workaround
View 1 Replies
View Related
Aug 1, 2006
i have some columns which contain the IF function and so it returns me a value in each cell. Is there any way to copy only the values AND insert shift down the copied cells onto somehwere else?
View 3 Replies
View Related
May 20, 2013
what I need is to insert the data in a cell, and instead of copying this same data to other cells in the same sheet or in other sheets, I need a way so that once I insert the data in one cell, it will be copied to the other cells at once.
For example, if I insert data in the cell [Sheet1,A1], it will be copied to [Sheet2,A4] and [Sheet3,E8] and [Sheet3,I7]
View 2 Replies
View Related
Feb 20, 2014
I regularly run a report that comes out in a slightly different format each time depending on whether or not there is data for specific criteria. for instance (sample attached): criteria a, b, and c are in rows, 1, 2, and 3 in columns. a, b, and c are expected to repeat themselves several times. if there is no data in one instance of b then you may see something like abcacabc.
I'd like to loop through each row in column a, check to make sure that it is the correct value (either a, b, or c) and if not, insert a blank row so I can then copy the data to my final project without having to worry about formatting.
the example above would then become abca cabc
View 3 Replies
View Related
Mar 9, 2007
I am trying to a input a list of cells in a column depending on what option i select from a drop-down list (or validation list) eg. If in A1 I select "fruit basket" (from a drop down or validation list) I then want this option to input in Column B Items located in another dynamic range eg. Apple, Banana, Orange, Grapes.
I have attached a sample of what I am trying to do to help explain my situation.
I find these forums a great key to learning the intricacies in Excel.
View 6 Replies
View Related
Jul 4, 2012
I have an excel file connected to a digital reader. Values are inputted to cells. What I can't figure out is the formula to automatically insert the values into the desired cells.
In short. First value goes to A1, 2nd value goes to B1. There's a formula (=A1-B1) in C1. The 3rd value from the reader should go to A2. The 4th value to B2. The 5th value to A3 and so on. I believe that I should be putting a formula into B1,2,3..n. What I can't figure out is that formula.
View 2 Replies
View Related
Jun 13, 2014
I have a large list of cells in excel: 15, 33, 90, 102, 149, 159, 217, 228, 238, 247, 305, 312, 369, 417, 428, 486, 538, 548, 606, 621, 671, 679, 737, 805, 816, 874, 915, 923, 981, 1029,1038 .
Under each of these cells I would like to insert 20 blank rows. I have tried various codes but i'm struggling with the fact that as soon as I insert 20 rows at cell 15, all the other cellnumbers change.
This is a reformulation of this post: [URL] ...........
View 1 Replies
View Related
Sep 14, 2009
I've been using the following macro ....
View 8 Replies
View Related
Feb 26, 2013
I have a spreadsheet with 27 Columns and 439 rows of data. I need to copy each row of data that has a certain criteria and paste the same data 141 times below it and then manipulate the data. In the same spreadsheet I need to copy a row of data that has other criteria in it and past it 30 times below it, and then manipulate the data.
I have been using the copy and insert copied cells function, but I have to scroll down 141 or 30 rows each time to ensure I add in the correct amount of rows. Is there a more productive way to do this? I have about 10 workbooks with approximately 47 tabs/worksheets each that I will need to update in a similar fashion.
View 4 Replies
View Related
Jan 8, 2013
I want my IF function to populate two cells with two values if argument for IF function is found TRUE. Is it possible?
IF(logical_test, [value_if_true], [value_if_false])
value_if_true = return multiple values in mutiple cells (for example put number 8 in cell A2 and number 10 in cell A3 if function is TRUE)
How would I do that? I tried putting IF(logical_test, (A2="8",A3="10"), [value_if_false]) but it is not possbile...
View 3 Replies
View Related
Oct 7, 2006
Sheet 2 is the problem.
I need to match cells e3:h3 whenver the dates change in in cells c5:c9 and then put there result of cells b5:b9 into the corresponding cells of e5:h9.
Basically what I'm saying is that I want to keep a track of all previous pay amounts from each pay period. So when the next period changes the date it also copies the new pay amount to the corresponding date of the previous pay section.
I have included a sample.
View 9 Replies
View Related
Jan 25, 2009
I currently have a cell with a formula like this: =C5*B4 + F5*E4 + I5*H4 + L5*K4
ie the columns in each couple increase by 3. I now want to add more source cells say like this: =C5*B4 + F5*E4 + I5*H4 + L5*K4 + O5*N4 and possibly onwards. Is there a way of doing this in some kind of shorthand? =LOOP(C4,stepH,stepV,noOfSteps) * LOOP(B4,stepH,stepV,noOfSteps) or something?
View 2 Replies
View Related
Oct 28, 2008
I'm not sure if this can be done but if I had the numbers 1, 2, 3, 4 and 5 in cells A1, A2, A3, A4 and A5 respectively, is there a formula that I could put in another cell to display "12345"?
I was playing around with the consolidate function, but I couldn't get it to work, and it's not a formula, it is done after the fact.
(PS. I've got no idea about macros)
View 2 Replies
View Related
Jun 5, 2006
i am having a list of values thru A1:A10
as under:
10.1
3.2
1.4
2.0
4.0
5.5
3.0
0.5
1.1
0.5
what i want is to retain the rows A4 and A9 alone, after offsetting
A2+A3+A6 against A1 (10.1)
and
A7+A8+A10 against A5 (4.0)
View 9 Replies
View Related
Jul 24, 2009
I need to see if it is possible to set up an IF statement that can pull information from cells based on the results already available in those cells.
ABCDEFGHIJKLM1Non FeaturedGoodGoodIdentical IMEIsGoodNeeds RLM NumGoodGoodGoodChk DOA BoxGood32Non FeaturedNo ExchangeGoodGoodGoodNeeds RLM NumGoodGoodGoodChk DOA BoxGood23
What I need is a formula in cell M1 that will check each cell B1 thru K1 for the data "Good". If it does not equal "Good", then I need the checks true/false value(s) to show the reason shown in the other cells.
In other words, for row 1, i need a formula where the outcome would be "Identical IMEIs" because D1 is the first box in the set that does not equal "Good". Then if D1 was corrected to "Good", the outcome would then be "Needs RLM Num".
I tried to do it in sections such as {=IF(B7"Good",B7, then the next check )} but the number of statements exceeds the number of IF statements that can be nested. And I really need the formula to fit in one cell.
View 9 Replies
View Related
Oct 14, 2009
I am running a 8 ball pool league and I am using a excel file to keep all the results in. We have over 200 people so the list is quite long.
Here is my problem. I have a list of 200 player with columns from left to right stating which days they are playing on. In each of these columns I note if that player won 3-0, 2-1 or lost 0-3, 1-2. The 3 and 0 or 2 and 1 are in separate columns. I am trying to write a formula to look for the players who have won 3-0 the most times to show how consistently well he has played.
I have tried =COUNTIF(A2:Z2,3) and this works fine, but the problem is, is that it counts the 0-3 that he lost as well, I only want his 3-0 win. His win score is always the first column so if he wins 3-0 I want it to count all the 3-0 wins and leave the 2-1 win or the 0-3 and 1-2 losses.
View 9 Replies
View Related
Sep 12, 2006
I am trying to enter a value in cell F1 by comparing the values in cells A1,B1 & C1. By using 'if, and, or' functions I can automatically input a figure for a limited number of values in A1 to C1. What I need to do is lookup from a database for say 10 possibilities in A1, five in B1 and 35 in C1 returning the correct number for the combination in F1.
View 4 Replies
View Related
Aug 4, 2014
I have a spreadsheet with a list of about 3800 lines of dollar values in "K" that correspond to various serial numbers in "E".
These serial numbers come up multiple times at different place throughout the 3800 lines.
I know by using SUMIF I can calculate the total value of each serial number, but is there a way to bring the serial numbers across to correspond to the sum of the dollar values?
View 5 Replies
View Related
Aug 15, 2014
I have a spreadsheet, similar to the one attached, that monitors deliveries. The reasons for deliveries not being made on time are merged across to have one reason per delivery vehicle.
I am trying to count the number of times a reason occurs, but utilizing a COUNTIF function it will only count a merged cell as one count, rather than per each delivery.
Merged Count if examples.xlsx
View 8 Replies
View Related
Oct 23, 2009
My columns are labeled A B C D etc... If the product I am creating the table for falls into one of those categories I place a 1 in the cell. For instance, ProductA falls into the A and B categories, so column A will get a 1 and column B will get a 1. This is so I can sort all of category A's Products etc...
I am looking for a formula to put in a column that would Say what categories ProductA falls into. ie Since ProductA falls into the A and B catergories but not the C and D catergories, This final column would say something like AB, or A,B or something.
Alternatively, I could make a single column entiltled 'categories' and put something like 'A B' in ProductA's column. In this case I would need a way to sort all A's or sort all B's and not just sort all 'A B'
View 9 Replies
View Related
Oct 11, 2011
I'm currently working on a test matrix that has high level and mid level test cases. The High level results cell is tracking all mid level test cases below it. If all mid level test cases are displayed as "Pass" then the High level test cases displays "PASS". If any of the mid level test cases is not displayed as "PASS" then the High level test case result is displayed as "FAIL" However, "PASS" and "FAIL" do not accurately represent the status of the test cases in the instance of them not being filled out. Mid Level test cases start off in the "Select Result" state which basically says it that test has not been performed. I would like to have a third value displayed as "NOT COMPLETED" or "IN PROGRESS". Below is the current formula that I am using.
=IF(AND(C50="Pass",C51="Pass", C52="Pass", C53="Pass", C54="Pass", C55="Pass", C56="Pass"),"PASS","FAIL")
On thing to keep in mind that may or may not make a difference is that one of the High level test cases has 30 mid level test cases and from my understanding, IF / AND function only allows up to 30 logic inputs (not sure if that is the correct terminology or correct at all).
View 8 Replies
View Related
Jul 22, 2012
I'm so proud of how i managed to get my first VBA project working. Yet there is one thing that's missing:
I would like to know how i can get the data entered in the cells to the left actively show in the textbox to the right.
Because i want to make a standard solution that can be copy pasted from the text field easily.
Screenshot of current VBA project.
View 6 Replies
View Related
Oct 23, 2012
I'm trying to set up a a spreadsheet where a user can enter search terms to filter a list of data. I'm using Advanced Filter so I can use wildcards and operators (>, < etc) and copying the results to a "results" sheet.
My problem is that some of the data entries have multiple values associated with them and this makes the filters values act funny. I have come up with two ways of setting out the list so far but both have faults:
Option 1: Use Alt+Enter to separate multiple values ie:
Description
Asset #
Site
Product Type
Speed
Comments
[Code] ....
I can filter this table for machines with a speed of 1000 using the advanced filter parameters:
Description
Asset #
Site
Product Type
Speed
1000
*1000
1000*
The user gives an input of "1000" and the spreadsheet automatically adds the wildcard * on the two rows below so that the advanced filter looks for Speed = 1000 OR *1000 OR 1000* (this collects the speeds 15001000 and 1000800) I would get this as a result:
Description
Asset #
Site
Product Type
Speed
Comments
[Code] ....
The Problem: I can't think of a way to use operators like > or
View 9 Replies
View Related
Nov 7, 2008
I am trying to find a way to use information in one cell in order to look up corresponding multiple values on another sheet. The problem that I am running into is that VLOOKUP only returns the first value. I need the values to be calculated in different cells going vertically, not all combined in the same cell as was in an earlier post. I am not looking to sum anything so a pivot table also doesnt work.
Sample data:
A / B / C / D
Identifier / Pub ID / Invoice # / Job #
ABCD1234 / ABCD / 1234 / A41254
ABCD1234 / ABCD / 1234 / B41254
ABCD1234 / ABCD / 1234 / C41254
DCBA4321 / DCBA / 4321 / A56789
etc.
I am looking for it to do this:
A / B
Identifier / Job #
ABCD1234 / A41254
/ B41254
ETC.
I want to enter ABCD1234 into another worksheet and have it return all of the job #'s, but I have a lot of these so I don't want to have to look up how many job numbers there are associated with it and have to enter different formulas into multiple cells. Filtering also isn't an option as there are simply too many cells to calculate.
View 11 Replies
View Related
Dec 20, 2012
I have to correct a spreadsheet that takes a bunch of values and creates an average.
=average(N15;N29;N43;N57;N71;N85;N99;N113;N127;N141;N155;N169;N183;
N197;N211;N225;N241;N255;N269;N283;N301;N315;N329;N343;N357)*100%
I didn't create this. Anyway, the problem is that most of these cells will be empty unless a whole bunch of other stuff is filled. These N cells take several values, put them together and create a new one. As time goes by they are filled. While they aren't filled, they'll return the DIV/0 error.
So when that formula I pasted there uses all of these values, it also returns a DIV/0 error because it is getting info from cells that have this error.
I managed to correct that with this
=averageif(N15:N357;"<>#DIV/0!")*100%
It works like a charm save for one problem. When I use averageif I'm forced to use an interval. Along this interval other values show up (it is always a value ranging from 0 to 2). So when the formula works its magic the results are slightly skewed because of this other value that I don't want.
So I figure there must be two ways around this. The first one would be using something like averageif that lets me use several handpicked cells instead of an interval. If I try
=averageif(N15;N29;N43;N57;N71;N85;N99;N113;N127;N141;N155;N169;N183;
N197;N211;N225;N241;N255;N269;N283;N301;N315;N329;N343;N357;"<>#DIV/0!")*100%
It doesn't work, it says I have too many values. So if I could the exact same thing as I did with averageif but keeping all of these values it'd be super nice.
The other solution, less nice but equally effective I guess, is using this same interval but having more than one criteria. The first criteria would still be the one telling it to ignore DIV/0 error, the second criteria would be the one to ignore any values equal or lower than 2.
View 5 Replies
View Related
Mar 13, 2014
So I have a list of organizations in Column A, with multiple names (anywhere from 0 to 50 names) for each org. in Column B.
Org
Names
Company A
Brown, Jones, Smith, West
[Code]...
I want to do a find and replace for all of Column B, where all the names are replaced with their respective color values. If possible, I'd like this to all happen with the individual cells (so for example, B3 might go from "Brown, Jones, Smith" to "Red, Red, Blue").
If that's not possible, I could divide all the names into individual cells and then find and replace.
View 3 Replies
View Related
Dec 2, 2011
I have a sheet that column G and column H has duplicate values. I would like to be able to put a formula in a cell P4 that will search thru column G and column H and if there are any matching items then add the corrisponding number in column I.
So say cell G8, G25, and G30 have the same and H8 and H30 have the same value, i would like this to add the values of cell I8 and I30.
Windows XP
Excel 2003
View 9 Replies
View Related
May 31, 2014
What i'm trying to do is i would like to compile in 1 column all duplicate values from multiple cells.
ex. A1 to 10 is numbered 1 to 10 respectively, B1 to B10 is numbered 6 to 15 respectively. which means in A1:B10 the duplicate values are 6,7,8,9,10. i could like these number to show automatically in C1 to C5.
View 9 Replies
View Related
Aug 2, 2007
In what would be Cell E2 I want to post the Total posted set Assuming that the Order Numbers and the OP Numbers are the Same, but only if there is a value in the allowed set, So I'd expect E2 in the case below to read 1.83,
Order No OP Posted Set Allowed Set
30761157 00100.731.500
3076115700100.500.000
3076115700100.600.000
3076461000100.000.000
3076461000101.050.500
3076524400100.000.000
3076524400100.550.500
3076639600100.000.000
3076639600101.180.500
3076810900100.000.000
3076862900100.000.000
3076862900100.000.000
3076862900100.000.000
View 9 Replies
View Related