Place Specific Cell Values Into An Array
Aug 23, 2006I want to get each distinct values from a range (say, c1:c20) and put them into an array for further processing.
View 3 RepliesI want to get each distinct values from a range (say, c1:c20) and put them into an array for further processing.
View 3 RepliesI am after a macro to do the following, my visual basic skills are very limited (non existant):- Look at the date in cell A1 on Sheet 'Live Report' and err 'remember it' Copy a range of cells from A3 to A10 on 'Live Report' Go to sheet 'Monthly Summary' and find the date that had been remembered previously (this date will be in column A on 'Monthly Summary' which will probably be a mixture of values and formulas). After the date has been found paste special and transpose the 'values only' copied range from 'Live Report' (A3 to A10) in column B on 'Monthly Summary' next to the date that has been found in Column A.
View 2 Replies View RelatedIs someone knows how to place the mouse’s pointer at specific location on the worksheet, at the end of macro run?
I would like to add VBA code in macro of a Commad Button, that can do that.
find a way to place a value of 1 (or a text "email sent: mm/dd/yy") in a specific cell on each row when an email is sent out through some VBA code I currently have. Then when the workbook is opened on another day, the code will look to see if that cell (target) is populated so that it doesn't trigger a second, third (repetitive) email every time the workbook is opened.
The spreadsheet contains rows of many clients, and growing every week. The code needs to be designed to search through each row, along a specific column (lets suppose column R beginning at row 7). When it finds the target rows blank, the code will turn each target cell red, as well as trigger a message box alerting that follow-up action is required.
I am trying to select specific values within an array.I have two tables, weight table and a factor table. These tables are a lot bigger than the example. I am trying to multiple the weights times the corresponding factors and then sum the result in one cell using arrays.
The third table is the result I am looking for. However, I would like to use some type of index/match or choose to get the result but cannot figure out how to do it. A couple of functions that I tried that did not work are next to it.
The index fails because the index function does not output an array (The result of the index function is just 4% instead of {4%,3%,4%}). The choose fails because the choose function does not select values within an array (ie I would have to put each factor as a separate value (F4,G4,H4) rather than the entire array (F4:H4). There are so many factors that I would like to avoid that.)
Sheet3
ABCDEFGH1 2 3NameWeightFactor DateFactor1Factor2Factor34Name125%Factor3 7/1/20105%3%4%5Name235%Factor2 8/1/20107%2%3%6Name240%Factor3 7 8DateReturn Does not work 97/1/20101.04% 4.00%#VALUE! 108/1/20102.65% 3.00%#VALUE!
[Code] .......
Array:
Produce enclosing { } by entering
formula with CTRL+SHIFT+ENTER!
I have a table like the one below, only it has a few hundreds of rows and columns and I need a solution in order to fill in the blank spaces with 0 and 1 in order to get the total by row and by column. Is there any way to do this with a formula/macro ?
1 May
2 May
3 May
4 May
a
2
b
[code]....
I have a user form that has 12 check boxes corresponding to the months on the year. All or none of the check boxes can be ticked at the same time. How can I get the value of the check boxs to one cell on the worksheet.
ie. Check boxes 'Jan', 'Feb', 'June' and 'Oct' are ticked. On the worksheet, cell A1 would say 'Months chosen: Jan, Feb, June, Oct'
how to set a cells value into a variable, using .value, then set another cells value equal to that variable without using copy/paste
What I can't figure out is how to see the value of multiple cells to a variable and place them into another range of the same size using .value. It would be nice to free up the clipboard.
I am trying to place the contents of an array into a column on the sheet. I can enter the array into 1 cell (which strings the values), but I can't seem to make range(1)=array(1).
View 9 Replies View RelatedI have a list of Items and the quantities of those items on one sheet. Each item has a section location number as well. (three Columns, Item, Quantity, and Section Location). the list can repeat the same item multiple times.
This is why I then have a summary sheet to uses a SUMIF formula to sum the quantities of a given item that are in a givin section. which my SUMIF Formula works great for. But my problem is some items have the word "LUMP" as its quantity and not a number. I want to add to my array formula so if the item does have a LUMP quantity and the lump quantity is in the section location to put LUMP on the summary sheet. here is my formula
=SUM(IF((ProjectInfo!$AE$2:$AE$307 =$B59)*(ProjectInfo!$AD$2:$AD$307= AA$10),ProjectInfo!$AF$2:$AF$307,""))
projectInfo is the sheet where the list is. Column AE is the Item column on the projectinfo sheet column B on the summary sheet would be the item that i want to sum the quantities for Column AD is the section location column on the projectinfo sheet the AA$10 is the row and column of the section location i want to limit the sum of the quantities to the formula is in cell AA59 So it will sum all the quantities in the list on the projectinfo sheet if the item and section location match whats specified on the summary sheet.
getting LUMP to display if its a lump quantity. The Lump can only show up if the item on the projectinfo sheet has LUMP for that Item AND in that section location.
EDIT: Column AF on the ProjectInfo Sheet is the quantity column
I have some 9digit numbers and i have to enter the number 9 afther the fourth digit. Example : 50200491 - turned into 502900491.
View 5 Replies View Relatednow I thought about recording the macro, but it's an offset and if you click the chart, then it'll mvoe somewhere else even though the charts are always placed in the middle when generated. So I think I need to place it in a specific range. I want to use XY coordinates or range labels or something to that effect but would like something to this affect:
With Charts.Add
.ChartWizard source:=Worksheets("sheet1").Range("a1:a20"), _
gallery:=xlLine, title:="February Data"
End With
I got that in VBA help, but I'm not using Chart wizard, my code just creates the chart from the data on its own with specific chart type. So anyway, how would I make it put each of my five charts for the 25 people in the same place for every person. Performance Errors etc etc etc all will go in the right place everytime, regardless if you start with the page scrolled. I should do range right, but how do I change this macro to do it without chart wizard...just a chart that's already created and named. QUESTION: How do I place charts that are created from a data source onto a specific area of one worksheet, and those charts are always in the same place regardless of the person'a name.
I'm working on an assignment that pulls information for different countries and I'd like to know how to go about placing the charts on a specific area. Any help would be greatly appreciated!
The concept:
With each click of a country, the country's information will be pulled from a 'data dump' that I created in the same file. The map and flag are also shown. Some of that information is just using lookups, or a combination of lookups and code, and the hardest part are the GRAPHS - which I'm having a really hard time placing and adjusting accordingly.
The problem:
As of now the charts are automatically filled as the user clicks a new country, but all of the charts are placed in weird locations, but I'd like for them to be placed in the specified ranges above.
I would like charts in the following ranges:
A20:B30 (Immigrant Group)
D20:E30 (Ethinc Group)
F20:G30 (Languages)
F13:G19 (Religion)
D10:E17 (Age structure)
This is the major part of my project that I need to complete. Any help would be greatly appreciated, PLEASE. =)
Right now I have ranges that aren't accurate, but regardless of how I try to show my range, the function does not work:
Sub CreateCharts()
Dim counter As Integer, chartname As String, xvals As String, offset As Integer, Range As String
'Delete all charts
Dim oc As ChartObject
For Each oc In ActiveWorkbook.ActiveSheet.ChartObjects
oc.Delete
Next oc
Sum every instance of [SPREAD]*[SIZE] where [NAME] occurs within a text string.
Please note, I'm trying to do this without creating a new column [SPREAD]*[SIZE].
Is it possible to add cell values to an array i.e. Array(cells(1,1).value,Cells(2,1).value)
View 9 Replies View RelatedI seem to be incapable of creating an array to return all of the values in each of the cells in the first row so that I can populate a combo box. I managed to do it without a problem for copying the sheet names within a workbook but not for this and I want to bang my head against the wall!
Basically, I have the first row of my spreadsheet for which I don't know how many columns contain data so my range is variable.
I then need to take the value of each cell and add it to my combo box (Later I would also like to use this routine to create and append sheets in other workbooks).
i'm trying to do my homework which requires me to pass values from an array in excel worksheet to VBA and print it in a msg box
i've tried
dim arr as variant
arr = range("A1:A6").value
msgbox arr
but it didn't work.
that's the first step of the homework the second is i have 2 list of array
year:1999 - 2002
profit:10,20,30,40
i have to find the max profit and get the year when it occurs
I need to convert a cell that has a list of values A1 = 1,2,3. To a range expression {1;2;3}. I want to do this with a formula and not VBA. Example: Cell D1 has the formula = SUMPRODUCT(COUNTIF(C30:C31,A30:A32),B30:B32). I want to put the list range from column C into one cell.
ABCD
110140
2203
3305
450
560
I have a sheet that lists all of the suppliers that we use (A2:A10). I have code that pulls the total number of reject by month for each supplier (C2:C10). What I would like is a formula that takes those values for the supplier and places them next to each other in columns E (see E2:E6) and does the same with the total reject values next to the applicable supplier (see F2:F6) without all of the zeros.
I think it is some kind of index and match function but cannot figure it out. I have attached an example of what I am trying to achieve.
Also, if at all possible, I would like to know if there is a way to auto populate a chart with those values and not the blanks that are generated (row 7 down in my example) so that my chart does not contain a bunch of blank space.
I am trying to return an array of values into 1 cell.
Basically, I have a gigantic list of item names, item numbers, and reuse codes.
I want to populate all the reuse codes by item number in a second sheet:
something like this:
Source sheet
Item item num Reuse code
Widget1 w001 298767
Widget2 w002 4894957
widget3 w003 28276
Widget1 w001 12345
Widget1 w001 678910
What I want this code/formula to do is consolidate the reuse codes based on the item number.
Aggregate Sheet
Item item num Reuse code
Widget1 w001 298767;12345;678910
Widget2 w002 4894957
widget3 w003 28276
I have this formula but it only gets the 1st Reuse code, I want it to get ALL reuse codes for that item.
{=INDEX('Reuse list '!$P$2:$P$24489,SMALL(IF('Reuse list '!$E$2:$E$24489='Status Sheet'!A11,ROW('Reuse list '!$E$2:$E$24489)-ROW('Reuse list '!$E$2)+1),1))}
I am trying to compare the values in an array with the values in a range of cells. It worked fine until I moved the code into a sub. The specific problem that I am having is that is pulling cell values from "shippablegoodspriorday" and it is supposed to be pulling the cell values from "shippablegoods".
module1
Call compareSheets(priorShippable, Sheets("notfound"), Sheets("variance"), Sheets("shippablegoods"), [A:A], 11)
module2
Sub compareSheets(goods() As Variant, WS As Worksheet, WS2 As Worksheet, WS3 As Worksheet, col As Range, offset As Integer)
With WS3.............
I have a database with 2 un identical columns: A, and B. Each cell in Column A should have an equivelant cell somewhere in column B. I want a code that could compare each cell in column A with each cell in Column B. Cells in A that don't have equivelant in B should have their values printed in column C.
View 4 Replies View RelatedI am building a marketing dashboard that shows the effectiveness of two campaigns based on where the campaign has been deployed (website, email, facebook, twitter, google+ etc.). In each campaign I have a checklist (using developer ribbon) with these different dimensions.
I want a formula that checks the checklist, identifies all the boxes that are unticked and returns them in a single cell. The cell would read:
To increase traffic to the Shampoo campaign (Campaign A), expose it to Google+ and Facebook as these channels generated 578 and 2009 visitors respectively for the Makeup campaign (Campaign B).
I already have it working for returning a single value with the following formula but need it to return multiple values.
=IFERROR("To increase traffic to the "&B4&" campaign, expose it to "&INDEX(L4:L10,MATCH(K5,M4:M10,FALSE))&" "&"as"&" "&"this channel generated "&VLOOKUP(INDEX(L4:L10,MATCH(K5,M4:M10,FALSE)),L26:N31,2,FALSE)&" visitors for the "&D4&" campaign","")
I am building a marketing dashboard that shows the effectiveness of two campaigns based on where the campaign has been deployed (website, email, facebook, twitter, google+ etc.). In each campaign I have a checklist (using developer ribbon) with these different dimensions.
I want a formula that checks the checklist, identifies all the boxes that are unticked and returns them in a single cell. The cell would read:
To increase traffic to the Shampoo campaign (Campaign A), expose it to Google+ and Facebook as these channels generated 578 and 2009 visitors respectively for the Makeup campaign (Campaign B).
I already have it working for returning a single value with the following formula but need it to return multiple values.
=IFERROR("To increase traffic to the "&B4&" campaign, expose it to "&INDEX(L4:L10,
MATCH(K5,M4:M10,FALSE))&" "&"as"&" "&"this channel generated "&VLOOKUP
(INDEX(L4:L10,MATCH(K5,M4:M10,FALSE)),L26:N31,2,FALSE)&" visitors for the "&D4&" campaign","")
I have a class module with several private variables, including one that is an array of a user-defined type. I am trying to set the values of a single element of this array with "Property Let ..." from a string array:
View 4 Replies View RelatedI'm creating 10 'categories' for Column "C" that I plan on using drop-downs to select from. Column "H" has a value tied to "C". What I want to do, is have Excel SUM all of the values in Column "H" where the Category in "C" is a specific text value (e.g. say a category is "hardware", I want a cell with a formula that sums all of the values in "H" where "C" is "hardware".)
View 8 Replies View RelatedI have a spread sheet with following:
Name|Address|Home Phone| Cell Phone| Status|Project Name|
I want to select name and extract only home phone and cell phone nos.
Please help me with a code. I have about 2500 entries.
i'd like formula to find value above and below specific cell
for ex
i have value in cell c5
i want formula helps me to find
values above c5 in cell c4,c3,c2,c1
and
values below c5 in cell c6,c7,c8,c9
as-18542-1
sp-25641-1
as-35678-4
u can see in that no last part like this.-1,-2,-4
i need to remove that part.i have lot of no like this.i am going to do this manually it will take long time.pls some body can make macro or something for this.
answe should be like this.
as-18542
sp-25641
as-35678
I want a range to be filled based on 2 cell values in my sheet. The autofill range should be filled based on the values in the input range. For instance in cell A1 I place the value 1 and in cell A2 I place the value 10, then the macro should automatically fill in the numbers from 1 to 10 in another column. If I change for instance the input values to 5 and 15, then the autofill range should fill up the numbers from 5 to 15.
View 4 Replies View Related