How To Select Value Most At Right In An "irregular" Table
Sep 26, 2008
I feel quite stupid about this one as it seems easy at first glance, but I just can't figure it out ...
I have a table with 4 columns (A B C D)and need to output in a 5th column (RESULT) the value that is most at the right on each line. The trick is that this value can be in any of the 4 colums, and is not always the biggest (max) value ...
P
A B C D RESULT 1 2 2 2 1 1 4 3 3 1 2 3 4 4
View 9 Replies
ADVERTISEMENT
May 17, 2006
I have this in my Macro:............
My Macro runs fine when there is something in Cell S2 but if there is not then I get an error on "Cells(sumrownum, 19).Value = "Total" 'Column S". What I want to do is put a if then type of statement that if S2 is empty the it will skip down to "Columns("W:X").Select" and keep going with the rest of my macro.
View 6 Replies
View Related
Jul 6, 2006
I would like to write a function that enhances conditional formatting capabilities in this way: suppose that cell(4,5) contains a number that can be 0 to 5
in the adiacent cell(4,6) i want to put a function that:
1) write "NO DATA", "HIGH", "GOOD", "MODERATE", "POOR", "BAD" depending on that value
2)Choose color font depending on value
3)Choose color background depending on value
I wrote this piece of
Public Function StatusResponse(AdiacentCell As Range) As String
Dim thisStatus As String
Dim ThisFontColor As Integer
Dim ThisbkColor As Integer
Select Case AdiacentCell.Cells(1, 1)
Case Is = 0
ThisbkColor = 2
ThisFontColor = 1
StatusResponse = "NO DATA"............
View 2 Replies
View Related
Mar 13, 2007
I have a procedure that processes data in a spreadsheet. It analyzes data in 365 sheets ( named "1" through "365") and creates a table/report with the results. When I run this on a scaled down version of my workbook (5 instead of 365 worksheets), the result is almost instantaneous. When this is on my normal workbook, the initial processing is about 1 second per day on Day 1, and the last day it speeds up to almost be instantaneous. It is not a linear relationship between the processing time (still working to get more exact timing information). Also, even if I limit my processing to 5 or 10 sheets, Days 1-10 are always slow and days 350-365 are always fast. The code being run is in the structure as shown below:
numSheets = 365
For counter = 1 To numSheets
x = CalculateSomething(counter)
Next
Private Function calculateSomething(counter As Integer) As Integer
Dim strCounter As String
strCounter = counter
With worksheets(strCounter)
For i = 0 To someNumber
For j = 0 To someDifferentNumber
'Data analyzed on worksheet
Next
Next
End With
End Function
The functions obviously aren't copied and pasted/functional, but the relevant efficiency stuff should be there.
View 5 Replies
View Related
Aug 26, 2009
I use the following code to get pivot table data source throught ODBC connect to CSV. However, when I chose hide item in "Page" fields, it showed "all" instead of "multiple items".
View 3 Replies
View Related
Mar 9, 2009
I am trying to prevent a out of memory error when all cells as selected.
Basically I am lookinf for a way to test if the user selects all the cells in a sheet.
Then if that happen I want to exit the sub.
Basically
IF "Select all" then Exit Sub
But I don;t know what syntax to use for the "select all" part.
I know that cells.select does select all but if I try
If ActiveSheet.Cells.Select is True then Exit Sub
I gets into some strange loop and Excel locks up.
View 9 Replies
View Related
Oct 8, 2009
I need some assistance in creating a MsgBox when an excel spreadsheet is opened and more specifically a particular sheet is opened. I'd like the Msgbox to say "Do not forget to select frequency in the blue shaded fields." I have read a guide which says just add a module in the spreadsheet eg.
Sub Msgbox ()
Msgbox "Do not forget to select frequency in the blue shaded fields."
End Sub
View 4 Replies
View Related
Sep 1, 2006
this is some real simple code but for some unkown reason it keeps failing on me..
Sheets("All Work").Select
Cells.Select
Selection.Copy
Sheets("Sheet3").Select
Cells.Select
ActiveSheet.Paste
Sheets("All Work").Select
The second Cells . select doesnt work for some reason when i attach it to a button on the work sheet and i get the message
"runtime error "1004"
select method of range class failed"
but when i run just the macro it all goes smooth.
View 6 Replies
View Related
Apr 3, 2009
I am having a little trouble with tying an index/match formula that would probably require an "if" portion to the formula as well.
If you take a look at the attachment, I'm trying to match column "G" to column "L" and then use the appropriate price according to the specified piece count in column "H" based on the table to the right.
View 2 Replies
View Related
Mar 22, 2009
I can't seem to find out how to use wildcards like "?" and "*" in the VBA- Replace("string","s*r","k") which should give "king"
View 3 Replies
View Related
Feb 10, 2009
In column A, I have the following values:
build
chil rat
datcen
mang
nextg
ost rat
omp
sco rat
In column B, I need the formula so it shows values that if column A = "build", "nextg" or "datcen", then the value in column B is "nextg" and if column A = "chil rat", "ost rat", "sco rat", then the value in column B is "mig". For everything else, it should be blank.
View 5 Replies
View Related
Jul 19, 2007
I have two worksheets, one with "supplier names", "order numbers" and "delay in days" as columns. The other one with "supplier names" and "average delays" as columns.
It is the column "average delays" that I have issues with, I need Excel to search the "supplier names" column in the "delays" sheet and identify every specific supplier name, connect the delay in days for that order and calculate the average delay in the right cell of the column "average delays" in the sheet "delay statistics".
I have tried the help files and to search this forum but I have found nothing. I have also with my knowledge tried a few different ways using the IF function but nothing so far.
This is something I started doing but it is of course far away from any truth.
=IF(;Delays!B1:B200="Greber")..............
This is the "delays" sheet where I want to find my info. Nothing in the delay column stands for "no delay"...Kinda obvious but you know... So even the "nothing" needs to be included in the calculation..
View 9 Replies
View Related
Apr 16, 2009
tell me which operator works in VBA the way the OR operator works in functions? I want to write an IF statement that will evaluate whether a variable is equal to any of the three punctuation marks ".", "?", or "!". But I'm not sure how to code it. I attempted the following:
View 2 Replies
View Related
Nov 4, 2009
Does any one know how I can resolve the calculation error that shows up in a pivot table when you select "show data as a running total in" option and you end up with a very small difference error.
In other words if I add 12.96 + 2.04 + (-15) and you get 1.455E-11 instead of zero. When these calculation errors show up in normal spreadsheet calculations outside of pivot table you can always use the ROUND function to correct these arbitrary calculation errors.
I'm looking for a recommendion for handling this in a pivot table where I have a couple of hundred columns of data that are using the "running total in" option.
View 9 Replies
View Related
Oct 16, 2009
I have a excel table in Cell B2:C2 to B10:C10 in sheet1. I need to copy this table "x" number of times as specifiedin A2, with an row offset (gap) of 10 rows starting D2 in sheet2.
But somehow, only the first row of the data is getting copied?
I have the following macro: .....
View 14 Replies
View Related
Nov 9, 2007
When I use "Select Case", how do I get my code to do nothing in certain circumstances? Example (and the maximum value of i could be any integer, as defined elsewhere):
Select Case i
Case 1
'do something
Case 2 - 5
'do something else
Case 6 - 8
'do nothing at all
View 2 Replies
View Related
Feb 2, 2009
Using a pivot table, I'm linking to an external data source in ACCESS. I use the pivot table wizard, select the database (spend2008.mdb), and then ONE table that is not in a relationship/linked etc, its just a plain table, and then I get the error
"The Microsoft Office ACCESS database engine cannot find the input table or query "mdb.summary". Make sure it exists and that its name is spelled correctly".
This is new spreadsheet, so new join to the data. I'm selecting the table from the Query Wizard, so not possibility of a spelling mistake. I've been all through the database to make sure I haven't set a link or relationship. There are a total of 4 tables in in the DB that are related, but I've deleted the relationships
View 7 Replies
View Related
Sep 25, 2009
I'm using for my pivot table so I always end up getting a "blank Field" in my pivot table.
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)
Col A
PswordTeacher MonthInfractions
2350538Obama h)Feb1
2350538Obama i)Mar1
2350538Obama j)Apr7
So when the above offset function is applied, it picks up the above 4 fields PLUS it adds a blank row to the bottom so it is actually picking up 5 fields.
View 8 Replies
View Related
May 11, 2008
I've been trying to make a "pivot table" of sorts, but I'm having trouble because I need to have a few columns - I wanted to have a "planets" column, then a "Weight" column and a "mass on planet", so that when a weight is entered the "mass on planet" comes up
I've worked out how to use the drop down list so only one planet comes up at a time, but I still can't work out why I can't have three columns - it just doesn't let me make an empty column that can be filled out.
Step-by-step instructions would be GREATLY appreciated as this is my first attempt at excel.
On another note I have a task to use excel "creatively", any ideas? I need to put in graphs, is it maybe possible to also put in GIF's?
View 9 Replies
View Related
Jul 10, 2009
In my spreadsheet below I want to be able to enter a sales number for January, the value of cell F2.
I want cells F3 thru F12 to automatically calculate according to the "Growth Per Month" value in cell H1.
Example: If January sales are 20,000, then February should calculate to 21,000 (january * 105%).
Excel Jeanie HTMLSheet1
E F G H 1 2010 Per Month Sales XXX 5% 2 XXX XXX 3 February $ 10,000 4 March $ 5,000 XXX 5 April $ 2,500 6 May $ 1,250 7 June $ 625 8 July $ 313 9 XXX $ 156 10 September $ 78 XXX 11 October XXX 12 November $ 20 XXX 13 December $ 10 14 $ 39,990
Spreadsheet Formulas Cell Formula F3 =F2*10*H1 F4 =F3*10*H1 F5 =F4*10*H1 F6 =F5*10*H1 F7 =F6*10*H1 F8 =F7*10*H1 F9 =F8*10*H1 F10 =F9*10*H1 F11 =F10*10*H1 F12 =F11*10*H1 F13 =F12*10*H1 F14 =SUM(F2:F13)
View 9 Replies
View Related
Dec 20, 2008
As shown in the below image. I have some data from A13 to I 13. Currently if I put the cursor on A13 and press DELETE button then all the formatting from A13 to I13 goes off. But the data still remain there.
Is it possible then when I press DELETE the content of A13 then all the data from B13 to I13 should also get deleted ?
Excel Jeanie HTMLSheet2 *ABCDEFGHI13Key FieldEmp 11 2 4 8 5 3 7 Excel tables to the web >> Excel Jeanie HTML 4
View 9 Replies
View Related
Jan 12, 2008
I hv make use of pivot table cal filed to get the profit in % variable.
my formula of profit in % = profit amt / sales.
when i get the result , only problem is the profit in % colume does not give me the result in %, i need to manually change.
it there any way i can set it in pivot table.
when i set the cal filed = profit amt / sales * 100% , i get 2 , but i want it to show 2%.
when i set the cal filed = profit amt / sales , i get 0.02 , but i want it to show 2%.
View 9 Replies
View Related
Oct 2, 2008
Is it possible to "macrolised" a pivot table?
Basically I need to create a pivot table on a daily basis based on a different spreadsheet everyday.
View 9 Replies
View Related
Apr 29, 2009
i just tried the below formulae but its not working. if Currency in col A and Currency col B is same it should be "Matched" if not same the "CCY Mismatch" and if "#N/A Sec" then "Security Not Found"
View 3 Replies
View Related
Feb 24, 2009
I need to prevent users from entering several rows of data seperated by a "/" or a "," or a blank space ""
We use unique identifiers (around 500,000 of them) so I cant really use a drop down box to populate and then make the user select.....
If a user populates a cell with "10005486 / 10045446" or "10005486,10045446" I want to highlight a cell red and then count the instances of red cells on another tab so I can track "errors"
I was intending to use conditional formatting when a "/" or "," or " " is used within a cell. If a user makes this error, I should probably include a msgbox saying why the entry they have made is invalid also....
View 9 Replies
View Related
Oct 22, 2009
I'm having issues with sumproduct. I can't seem to get the right info that I need. Attached is the file I'm working on. Problem: I need to get the number of people "Occupied", "Partly Occupied" and "Available" on a Monday, Tuesday etc of the current week. "Occupied" means an employee has more than 2 tasks (based on New and Active-To-Date status). "Partly Occupied" means an employee is working on 2 tasks.
"Available" means an employee has NO task at all.
View 2 Replies
View Related
Nov 20, 2009
I have attached an example workbook to this message, with the sensitive data removed. I am trying to vlookup the "cube" for the product number, into the PO worksheet, IF the vendor numbers match.
Example:
On row 2 of the "PO" worksheet, part number AC1000110, should have a cube of 2.5 for vendor # 11170. I'm trying to match the "Vendor" on the "PO" worksheet with the "Vendor" on the "Cube File" worksheet, and then return the corresponding "Cube", (in column F of the "Cube File"), in cell U2 of the "PO" sheet. So, what formula needs to be entered in cell U2?
View 2 Replies
View Related
May 12, 2009
I want to use a calculation within the Rows collection, but I get a type mismatch error. I realize it boils down to syntax, but I don't know what I don't know.
1. In place of, say, Rows("2:37").Select...I want to use Rows("2:x-2").Select where x-2 is a simple subtraction calculation. I also want to use two variables. I'd hope to be able to infer what to do from above, but just in case:
2. Rows("z:x-2").Select
View 4 Replies
View Related
Dec 7, 2008
I just discovered VBA coding today and was wondering if I could use it as an audio alert. I found a couple examples online but don’t understand the coding language of excel. I have a feed link from my trading platform to excel that feeds in live data. What I would like to do is have an alert for when Range ("C4").select is >=1000 Alert Ring.wav and when Range ("C4").select is <=-1000 Alert Chimes.wav.
View 5 Replies
View Related
Jul 20, 2006
For the following code, I'm getting the " Case without Select Case" error (On Case 3 to 5...assuming more are wrong too, but debug can't get there yet). I thought I had it right, obviously don't. Can anyone spot how my code is wrong? ....
View 9 Replies
View Related