Run Macro When Cell Condition/Criteria Met
Oct 6, 2006
Two ranges A1:A20 (input values) and B1:B20 (results).
Input values are always the digit 1 which starts the calculation and the result comes up in the cell to the right.
Example:
Input (1) in cell A1 gives a result value in cell B1.
Input (1) in cell A12 gives a result value in cell B12.
I need a macro “StartCalc” to do the following thing:
Go to cell A1.
Put in the value “1”
Check the result cell B1.
If “result value” > 20, then run macro “Test” (this macro is working)
Go to cell A2.
Put in the value “1”
Check the result cell B2.
If “result value” > 20, then run macro “Test” (this macro is working)
…….
Go to cell A20.
Put in the value “1”
Check the result cell B20.
If “result value” > 20, then run macro “Test” (this macro is working)
End of macro.
View 4 Replies
ADVERTISEMENT
Oct 16, 2006
Attach is a sample of my project. I have to loop through B9:B80 in sheet("Raw Data") and capture the value of each cell. EG:
* if Value captured is 120A --> check with sheet("SP14F") from the row which contains the same value.
* i have to check that the aperture, outer and inner values of Layer 120A and so on..of the Raw Data sheet is the same as that of in the SP14F sheet.
* if the values are not the same, change the font to red
i understand that this task requires looping and arrays.
View 4 Replies
View Related
Mar 26, 2013
In a particular sheet the data (with formulae) are present from rows E5:Q5000. I require a macro which automatically does the following:
- When user enters “submitted” in the row Column N, entire rows above that cell should be selected, and copy-pasted as values to remove all formulas. So if user enters “submitted”, at N31, then data set E5:Q31 should be selected and copy pasted special so as to retain only values.
-Finally the copy pasted data should be sorted as per the status of Column N.
View 4 Replies
View Related
Apr 8, 2009
I have accounts that I need to compare to see if they exist on my system the account that has a listed date, exist on my system then if I can fill the dates in the accounts the match then I will be able to delete the other accounts that don’t have a date see attach file for more understanding.
View 2 Replies
View Related
Mar 4, 2008
I am trying to create a macro that will look in Column B for the word "RPLCASE." Whenever "RPLCASE" appears in Column B, the cells in that particular row will move over (Right) one space. I am simply trying to align the data from a file that I FTP'd from Net Term to Excel. You can see how the data should look in the 2nd example.
14-Feb-08JERRPLCASE671150536:116:56RPLCASE78308147:077:54RPLCASE89431228:228:57RPLCASE910592289:159:59RPLCASE10114732310:0010:48RPLCASE1112146811:4511:58RPLCASE12136563612:0612:56RPLCASE13144122113:0313:58RPLCASE14154642314:0114:23**********--------------TOTALS4632228LDLPKGPIK671361126:046:58PKGPIK781461247:007:56PKGPIK8963598:168:55PKGPIK9101591309:019:59PKGPIK101115113910:0010:54PKGPIK1112968711:3211:59PKGPIK121319916012:0012:59PKGPIK131412310313:0013:59PKGPIK141518716414:0014:59PKGPIK15161119715:0015:54PKGPIK16173316:3016:31**********--------------TOTALS13741178
View 9 Replies
View Related
Mar 24, 2014
I am trying to perform a calculation in a cell that leaves the value 0 if before Feb 2014, changes to the value of another cell in Feb 2014 and leaves the value unchanged if after Feb 2014. I can get to the Feb 2014 value but after that month the value changes to 0.
The Cell formula that I am trying to use is as follows:
=IF(YEAR($A$3)<2014,"0",(IF(YEAR($A$3)>2014,H114,(IF(MONTH($A$3)<>2,H114,AA118)))))
A3 contains TODAY()
H114 is the cell being calculated
AA118 is the cell containing the calculated value for the current month.
View 2 Replies
View Related
Sep 18, 2007
I am trying to use an OR condition within a sumproduct formula. Why am I not getting correct results?
(see attached)
I want to sum all costs for each of my PO #s:
If the Rebate Type is IPT, Wireless, or Security, then the result goes in the "Fndtn Ext Cost" column
If the Rebate Type is IPT Advanced, Wireless Advanced, or Security Advanced, then the result goes in the "Adv Ext Cost" column.
The formula I am using is as follows:
=SUMPRODUCT(($A2=PO)*(OR(Rebate_Type=$F$3,Rebate_Type=$F$5,Rebate_Type=$F$7))*(Ext_Cost))
But for some reason, even though the OR statement is evaluating to FALSE (I tested it by itself), it's still summing ALL the extended costs for that PO #.
View 9 Replies
View Related
Oct 8, 2007
I am trying to create a macro using arrays to calculate average sales from a list of sale amounts that originate from different cities. Each city has its own city code and I want to display the average amount of sales for each city. The attached file is the template that ive created to do this. I am having trouble getting the arrays and loops to work. If anyone can help me out I would greatly appreciate it.CitySales2.xls
View 3 Replies
View Related
Apr 16, 2006
I want to be able to delete certain rows based on multiple criteria. If data in the row does not meat the crieteira, it shud be deleted. I have attached the excel file sample in which I want to keep the highlighed rows and detele the rest. Its base on Origin city and Destination city combination. Eg: If Origin city="A" and Destination City = "B", I want to keep the row. Like wise for all highlighted rows. but if the Origin City = "B" and Destination City = "U" I want to delete the row.
View 9 Replies
View Related
Feb 7, 2008
I have an Excel file ( book) that I use for scheduling my restaurant employees. There are currently formulas in place that retrieve information from cells on one sheet to a cell on another sheet. For example:
If, on the first sheet I schedule Joe the following section on Tuesday AM (D14), his name will be automatically shown on another sheet which list the section/floor plan in quick view.
I need a formula (on a third page) that will allow me to tell me how many times an individual employee has had this particular section. The sections are listed with a letter preceding it. Such as D**, P**, B**, SB**, etc.
View 3 Replies
View Related
Apr 16, 2008
I have been building a HR database. There are more or less 20 worksheets in it, including staff personal datas, contracts informations, overtime, leave etc.
All the calculations work, and I can print my payroll correctly. So everything is good.
However, what I really would like to do is to be able to print all salary slips in just one clic or two.
I think I have to create a VBA Macro to do so. But I never learned to use this tool. And I think this macro is too complicated to create for a newbie like me. So, I'd really like you guys to help me in creating it.
What I want this macro to do:
1° To check if the staff in question is still hired by the ngo
(I have on worksheet 'employee register' a column A named 'staff code' and a column Q named 'inactive'; i put a "x" when an employee is inactive, and the column automatically remains blank in the other worksheets)
2° If the staff is still hired, to print the salary slip of this staff
(I have a worksheet 'Salary slip' in which I have a cell (D5) that allows me to select the 'staffcode' in a validated list, when I select the staffcode, the information concerning the slip update automatically)
(my "staffcode" validated list still contains the inactive staffs, I dont know how to fix this)
3° Repeat this operation for all hired staff (all active staffcode)
View 5 Replies
View Related
Jan 3, 2013
I'm trying to create a formula that tells me the following:
If the item is marked as closed (vs. active), then how many renewals/terminations replacements/etc are there? These are two difference columns in a worksheet.
View 2 Replies
View Related
Sep 8, 2006
I have a data sheet which has a number of columns
I am only interested in one of the column which is 'Type'. Within this column it specifies the type of order it is. I would like to count through the sheet and get a final count of the different order types on the other sheet, so if there are 56 instances of 'trace' orders then I would like this displaying on the other sheet as Trace = 56, and so on
View 9 Replies
View Related
Nov 21, 2006
I have a spreadsheet with 3023 rows and columns A-L. Here's a small sampling of Column A (with heading "sku" included, copied exactly as it appears in the spreadsheet):
A
sku
3102-0400-100000
3102-0400-200000
3102-0500-100000
3102-0500-200000
3102-0600-100000
3102-0600-200000
3102-0700-100000
3102-0700-200000
I need to delete every row in which column A includes the text "200000".
Although the above sampling shows "200000" appears in every other row, that is not the case in all 3023 rows.
View 9 Replies
View Related
Aug 31, 2006
I have a piece of code that put a check in all checkbox in column B from row 5 to row 50 but in column C, I have data from row 5 to 38. I want the macro to stop at row 38 in column B. When the cell in column C is empty stop putting checks in column B. How can I make this macro Check all checkbox down column B and stop when column C is empty. How do I add a loop to stop when the cell in column C is empty?
Private Sub CommandButton1_Click()
Dim CB As Variant
For Each CB In ActiveSheet.CheckBoxes
CB.Value = False
Next
End Sub.......
View 3 Replies
View Related
Sep 7, 2006
I am using pivot table for my customer aging which a sample is enclose. What I want to do is to Highlight the field " Customer Name " in colour if the the Field " Type of guarantee" is other than 0. Also a message of " Credit limit Exceeded" if the outstanding is more than the Credit limit.
View 2 Replies
View Related
Oct 24, 2006
I have a spreadsheet that has 35000 entries and i am trying to count how many material are assigned to a particular group but cannot get it to work. I have included a test spreadsheet to explain what i am trying to achieve
View 3 Replies
View Related
May 24, 2008
In a data table, I need to sequence down a criteria list in Autofilter to the end. The list contains may contain either numberic or string dat, but no blanks. At each criterion, I need to copy the range and paste to another workbook. After reviewing many posts, I beleive I can create a VBA macro to do everything except sequencing.
View 2 Replies
View Related
Nov 20, 2012
I have multiple sheets with the same format.(all columns have same format) in column "A" i have a value lets say "B1-1".
What I need to do is to copy from all sheets the rows containing in column "A" the same criteria("B1-1") to a new sheet and skip the rows that have a blank cell in Column "A".
View 5 Replies
View Related
May 5, 2008
I did a search to find a question similar to mine and I found this:
Copying data matching a criteria into another spreadsheet
This is exactly the same concept I am trying to accomplish, but don't know how to...at all. I couldn't follow the thread either.
I have a schedule which is constantly being updated (simplier version attached). I want to create a schedule, which will:
1) First ask which region to display the information for (I would like to create the same pop up menu to choose from)
2) Then, it will select only that region's information (all rows & columns) and copy them into a new worksheet and lists it all
-if you go back to the Master List, you can again choose another Region and it will create another new worksheet with that region's information
3) Don't know if this is making things more complicated, but at the bottom of the attached file, there are 3 lines under "Land".
Is it possible to list these under the same spreadsheet as the region it is pertaining to but classify it separately under "Land" (ie leaving space, so it is clear this is separate
View 9 Replies
View Related
May 23, 2008
need a formula to calculate the total number of x's in one column (column B, C, E are training types= x) where the corresponding column date falls within a date range. It’s to total each type of training done for each month. I have 3 training type columns and a cell that calculates the total number of trainings for the each month:=COUNTIF(F2:F100,">="&DATE(2008,2,1))-COUNTIF(F3:F200,">="&DATE(2008,2,31)).
So now I just need it broken down by training type per month. How many x's in each column for February as an example.
View 7 Replies
View Related
Jun 2, 2008
Now what I am looking to do is search my spreadsheet for specific criteria and then copy and paste these rows of information to a new sheet.
In my first spreadsheet that I am using as a database, I want to be able to select any entry from the month and copy it to another spreadsheet named for that criteria.
In other words, I want to find every entry for January, copy just that data's rows and paste them to the January spreadsheet, February to February, etc. My date fields are in column A.
I also want to do the same with representatives names found in column B.
This will break down the data for each rep and each month. Using the filter, then copy and pasting would be cumbersome.
View 9 Replies
View Related
Jan 29, 2009
I'm trying to create a macro that takes data from one row and inserts it into a new row. Attached is a workbook with a before and after example of what I'm trying to do.
Each row has a security transaction that includes principal cash and interest. The data needs to be formatted so that each transaction has one row for principal and one row for interest.
Principal is identified by the tran code PAYDOWN in column C. Interest is identified by the tran code INT. However, the raw data generated includes both interest and principal under the tran code PAYDOWN.
There could be 100 or 1000 transactions generated based on the day.
View 2 Replies
View Related
Feb 20, 2009
I would like a simple macro that would actually move a cell based on criteria. In my case it would be: In row A, if a cell starts with 'Agent Name' then that cell needs to move down one cell replacing the contents of that cell.
View 3 Replies
View Related
Dec 7, 2006
I have gotten good modifying existing ones to fit my purpose but still have a lot to learn about creating them. I would like help in creating a macro that would search out several sheets (JanD.....DecD) and search for names in column K and a location name in column L. If the contents of the cells do not meet the criteria of name and location then I want the name to be changed to "OTHER".
View 9 Replies
View Related
Oct 5, 2006
I was wondering if I could pick up the Field number and the criteria from a cell in excel rather than changing the code in VBA.
Range("A1:K1"). AutoFilter Field:=Range("A1"), Criteria1:=Range("B1")
I was trying this code but I got an error message. Does anyone know if I can pick up these information directly from excel.
View 6 Replies
View Related
Dec 20, 2012
I am looking for a way of creating the following conditioned concatenation.
I have two tables, let's call them "summary" and "detailed".
The "detailed" table is something like the following:
ID
VOL
001
01
001
05
[code]....
The "summary" table below gets info from the "detailed" table. The 'ID'is now unique. I'm looking for a formula on the 'VOL (concatenated)' column cells it should get all rows from the "detailed" table with the same ID and then concatenate the 'VOL' column results, comma separated:
ID (unique)
VOL (concatenated)
001
V01, V03, V05
002
V01, V04
003
V06
PS: I have people using this table with office 2003, so compatibility is necessary...
View 1 Replies
View Related
Sep 14, 2006
I can't seem to find the answer to this. In VBA, how do you Find a cell or row based on multiple criteria? All I need is to find it's location. If it helps, here's an example:
Sheet 1 contains source data:
Date Name Time Complete
Sheet 2 contains an interactive worksheet using this data. On Sheet 1 there's an entry: 9/12/2006 George 03:30 PM
Sheet 2 displays those records with adjacent cells for entering data. When data is entered, I need the system to go back to Sheet 1, find the entry that matches this one, and put an "x" in the Complete column.
View 6 Replies
View Related
Sep 26, 2013
This is a continuation of thread 182629 [URL] ....
The End User wanted originally to type characters into cell C1 of a worksheet that the macro searched for in another worksheet, copying across every row containing the input.
The responses gave me the following code which worked perfectly:
VB:
With Sheets("PICKLIST")
myFind = "*" & .[c1].Value & "*"
End With
If myFind = "*" & "" & "*" Then Exit Sub
Unfortunately, the user NOW wants a Text Box instead of putting the characters into a cell.
I added a textbox (originally called 'TextBox2' but renamed "Choice") and "Dimed" CHOICE As Range.
Then tried the following code:
VB:
With Sheets("PICKLIST")
myFind = "*" & CHOICE & "*"
End With
But it generates a "RunTime Error 91" - Object variable or With block variable not set.
View 8 Replies
View Related
Oct 7, 2009
Does anyone have a VB macro that will copy information from a cell (this will be variable based on criteria) and paste it into the middle of another cell that contains HTML code?
The criteria for the copy/insert/paste is that the information in the cell that is to be copy/inserted must match up with the correct number (part number).
I hope this makes sense. I have attached an example spreadsheet. (Pictures are worth 1000 words. ) Hope someone can help. I checked this site and couldn't find anything that was solved that matched the specifics.
View 6 Replies
View Related