Macro Recognize A Number And Then Preform Two Tasks
Aug 24, 2009
Over the weekend I had to look at 220 strings of numbers, some strings with as much as 20 numbers and determine if the numbers represented red, green, blue, or yellow and how many of each color from a parent list.
I did it all by hand. After getting help here from JBeaucaire on my tally sheet, which I successfully recreated with their guidance, I thought I might ask this question. How would one go about creating a macro that would when it seen a certain number, it would put the color in the column immediately to the left, and the number of colors in the column immediately to the left.
I have 2 columns and 10 rows (A1:B10). In column A are certain text values. How do I write a macro to go through the table and preform an operation in the corresponding cell in column B depending on the value in cell A? for example, if A3 = "Complete", overwrite the formula in B3 with the value (paste value)?
I have a worksheet that runs a query from an external data program. I have made a macro that refreshes the worksheet and this works ok. Is there a way I can get Scheduled tasks to automatically update this workbook eg overnight. I do not want to leave the workbook open either. Can task scheduler open the workbook, refresh the data, then close the workbook again.
In the given example below how can i recognize the last number which is LV-00010 and after recognizing the last number i wanted to add 1 so the next number will be LV-00011 (im using this as an automatic ref. no.).
I have the following column: A1 B1 B3 Ab123 1278 what i would like is if cell A2 start with AB then B1 and if not then nothing AC125 1587 AF123 1365 AR125 1259
I would like another cell to check the cell where i have the two letters and the numbers. if the cell start with the number that i am intrested then to confirm it to me, or to give me a value from another cell.
In column B, I want it to show me the first 3 numbers from the left, (so 123)
So I do =LEFT(A2,3)
Which gives me 123, but it's displayed as text, which ruins my whole formula that looks up the area code and displays the state.
I googled the problem and found http://exceltip.com/st/Make_LEFT_Fun...umber/778.html
which tells me to do: =IF(LEFT(A1,1)=1,"Ignore",A1) [sees 1 as a number] =IF(LEFT(A1,1)+0=1,"Ignore",A1) [sees 1 as a number] =IF(LEFT(A1,1)="1","Ignore",A1) [sees 1 as text]
but when i try that it just displays the ENTIRE phone number: 123-456-1234
I'm trying to figure out a formula to be able to look at a column of txt and if it finds the word total it need to output the number at the column next to it. If the word total isnt in the text then it should leave it blanks (see below). Basically I want a column that pulls only the totals amounts in the column.
Aaron Drielick 3 Aaron Drielick 2.5 Aaron Drielick 37.5 Aaron Drielick Total 151.0 Akila Subagaru 31 Akila Subagaru 1.5 Akila Subagaru 1 Akila Subagaru 1.5 Akila Subagaru Total35.0 Albert Major 4 Albert Major 6.5 Albert Major 2 Albert Major 19.5
I'm trying to make a table of the total amount of a liquid used throughout the day. Here is what I am trying to do: In cell D4, I want to be able to enter something similar to the following: 3cup+2bottle+1liter
and by doing so, Excel can automatically recognize that 1cup is 8oz, 1bottle is 17oz, and 1liter is 34 oz because of the reference chart provided on the side. Also, it would be able to notice the 3, 2, and 1 amounts so it would multiply accordingly so it would know to do this: (3*8)+(2*17)+(1*34)
and then put the calculated amount in the cell. The correct answer should be 92oz. Is there a way for Excel to recognize the conversions (i.e. whenever it sees 'cup' it will multiply by 8) and multiplication factors (i.e. 3, 2, 1)?Is there a formula I can enter that I can just "drag" down to the upcoming days in column D?
I know I can just do something like this: (3*G4)+(2*G5)+(1*G6).
The code I have below is relevant to this spreadsheet Copy of Invoice test.xlsm
In the code below I marked the script that has issues in red. The code takes the last row and the last column and works from there. This works fine with single commands, however, when I take a cell (based off the last row and the last column) and try to give that cell multiple commands excel sends back an error. When I use this multiple command (see part of code that is marked in red) for a range that is not based off the last column it works fine.
I have a spreadsheet that contains a list of names/numbers/dates and I have to manually go through the list each day highlighting the row if it contains a date that is more than 48 hours old. How to accomplish this in a macro? Example:
That is the layout of the spreadsheet so I would have to manually highlight rows 2 and 4 because the date in Column D is greater than 48 hours ago. The range is A1:D25 and the cells are changed/updated daily.
I have a long (190,000) list of customer data, all in Column A (unfortunately with blank rows among it, but working now to fix that).
Down the column, individual customers are bookended by a "adf" and a "/adf". (these have open and close brackets like HTML code, but I cannot reproduce them in this forum).
For each customer, I need to find the rows that begin with (brackets spelled out since I do not know how to show them):
And transpose only those rows it into columns.There is a dynamic number of rows for each customer, so there's no way to simply count and transpose, as the columns would all be mis-entered.Somehow it needs to recognize those 6 row items, and transpose those values only, with the and the only telltale of a start and finish of a specific customer.
EDIT: How about a macro to delete all rows except those that contain those partial values above?
I have searched and think I have found what I need to create Outlook tasks from my Excel spreadsheet. I'm hoping that someone here can help me pull it together into something that will be usable in my project tracking spreadhsheet...
I try to keep track of milestones... these milestones are listed in column B of my spreadsheet and are in rows 10 through about 105
For each of my customers I then keep 4 columns D, E, F, G - H, I, J, K - L,M,N,O - etc. Each group of 4 is a different customer....
The customer's first column (D, H, L, etc.) is a Due date of the Milestone that is found in column B. The second column is a check box that I use to indicate when the milestone is complete The 3rd column is the completion date The last colum is just a filler space that helps to separate each customer.
What I would like to do is insert a button at the bottom of EACH grouping of 4 that when pressed would look at the first column for the customer group and for ANY Milestone that has a DUE date process the stuff in the VB below to create an OUTLOOK task for each item that has a DUE date. (It would be conceivable that as it stepped through each row for a customer group of columns that I could have it create 90+ Tasks in Outlook.
A couple of additional things... in row 110 for the first column of the customer I have a DATE or a blank. So for example in D110 it might be blank or a date like 10/29/2007. If it is blank then when I press the button it would loop through ADD the tasks for each row with a due date. If row 110 has a DATE I would get a popup indicating that the tasks are already in OUTLOOK and that they were added on whatever the date is in row 110... This is kind of the safeguard that I don't get the same group of tasks multiple times by pressing the button by mistake.
Im having trouble with getting a macro to run at a specific time and day (Every Thursday at 7PM).
Here's what I have done so far..
1. I added my excel file to the task scheduler 2. created a class module and place the code below into it.
In testing the workbook opened but it asked if i wanted to enable or disable the macros - how do I get around this? And it does seem to kick off the macro (create_all).
Private Sub Workbook_Open() If Hour(Now) = 1130 And Weekday(Now, vbMonday) < 7 Then ' TheNameOfYourCurrentProcedureHere create_all If Workbooks.Count = 1 Then Me.Save Application.Quit Else Me.Close True 'save the changes and close the workbook End If End If End Sub
I have a worksheet where I calculate the duration it takes for an operation. the format of the worksheet is as folows:
The worksheet is composed of Start and Finish times in this format: 2009/06/02 5:32:19 , so for example,
- Row1 of the worksheet will have "Start" in column H1 and the start time in column B1 - Row 2 of the worksheet directly below has the "Finish" time, with the Finish time information in column B2
So with the help of excelforums I was able to implement a macro to extract the finish time cell found in row B2 and offset it to C1 and do a simple calculation to get the duration in minutes and display it in column D of the same row as "Start".
I scheduled a task to open excel and when it does (at a certain time), a little sub is supposed to run (couple minutes later) via the OnTime Method located in the Workbook Open Event. There is one weird thing though....
1. When Excel opens automatically through Scheduled Task (and you see the clean white sheet WITH gridlines), Sub does NOT run (that is, my file is NOT even opening).
2. When I myself open Excel manually WITHOUT opening a new workbook (in other words, in front of you there will be grey area without gridlines), Sub runs perfectly (in other words, my file opens automatically and Sub performs whatever it is supposed to do).
I have a project network spreadsheet shown below and in column BT I need to identify each non-critical path task (value in column BS is "N") that has a critical path task (value in column BS is "Y") as one of it's immediate predecessors.
Predecessor tasks are listed with commas separating them in column G. They are also separated out into columns H through Q for another function in the spreadsheet.
I was given the following formula by Domenic some time ago that I use along with VBA code supplied by Fin Fan Foom to open do a lookup on a closed workbook:
=If(ISNUMBER(MATCH(MIN(If( Date=D2,If(ABS(Time-E2)<"0:30:30"+0,ABS(Time-E2)))),If(Date=D2,ABS(Time-E2)),0)),INDEX(Contact,MATCH(MIN(If(Date=D2,If(ABS(Time-E2)<"0:30:30"+0,ABS(Time-E2)))),If(Date=D2,ABS(Time-E2)),0)),"") Everything works fine, until I attempt to… - cut & paste a block of cells, or - do a SaveAs, or - change a worksheet name
The formula will no longer function after performing any of these tasks (the cells go blank), and I have to close the workbook without saving to preserve the original workbook functionality. All other tasks, including even importing of different files into the workbook have NO negative effect.
The formula uses an “INDIRECT” named range. Sheet name changes are reflected in the named ranges, but any change of names somehow causes a malfunction (no sheet names are referenced in the VBA).
I thought that the large lookup workbook (40,000 rows) may be a problem, but even after deleting most of the data and retaining only a few rows, the problem still remained.
After the formula cuts out (after performing the above tasks), if I open up the lookup file, then the lookup will work again, but if I close the lookup file, it will stop working.
I doubt the problem is in the VBA code since IT WORKS, and besides, I have other simple VLookups formulas that also uses the same process (and VBA code) and they continue to work just fine when that one formula gives out. The only thing I can think of is that the complexity of that one formula may be an issue.
Anyway, I the original thread is long, so I’m starting a new one here. The original thread is here (Domenic’s formula, pg 7; FFF’s code, pg 8): Dedicated Cell To Choose Lookup Table
I am trying to drag a numerical value down (X4-X10) but I need it to repeat two rows in between, simultaneously keep the numbering in sequence only after the repeats 2 rows in between, and perform the previously mentioned 2 tasks any row in a column. So far, I have to manually enter or when I select cell X4 and X5 together ( having a value of 1 and 2 respectively) and drag, the value does not repeat 2 rows in between and does not keep the numbering in sequence after the 2 rows.
At Present: X4 1 X5 2 X6 3 X7 4 X8 5 X9 6 X10 7
I need to have
X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ] 1 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+1 1 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+2 1 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+3 2 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+4 2 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+5 2 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+6 3 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+7 3 X [nsubscript1, or nsubscript2, or nsubscript3... nsubscript10000 ]+8 3
and so on...
I have a 2000+ rows to manually input and hence it is not practical!.
I have had some help with this (thanks!) but am stuck.
Can someone add to the code below and make it so that multiple tasks, with multiple assignees, can be created from a range of cells, such as:
Column A Column B Row 1Task SubjectAssign to Row 2GV LP for AZJohn Brown Row 3GV LP for COJohn Brown Row 4GV LP for ILSuzy Smith Row 5GV LP for INSuzy Smith Row 6GV LP for KYSuzy Smith Row 7GV LP for MNSuzy Smith Row 8GV LP for MSBob Barker Row 9GV LP for NCBob Barker Row 10GV LP for NJBob Barker Row 11GV LP for NMBob Barker Row 12GV LP for NVBob Barker Row 13GV LP for NYBob Barker Row 14GV LP for OHBob Barker Row 15GV LP for SCBob Barker Row 16GV LP for WVBob Barker
(Sorry, it didn't translate well. The "GV LP for AZ" is cell A2, "John Brown" is cell B2.)
I'm trying to auto input names from my schedule into dailytasks for my servers. Sometimes the amount of servers on a specific day changes(i.e Mondays 3 to 5 servers and Friday - Sunday there is 4-6 servers on) and times could change also as of now it works with
=VLOOKUP("6:00",AC$25:AJ$46,8,FALSE)
Not sure how to set up lookup value and return the name
I am using excel 2007. My issue is i have a front sheet that I want to list all my tasks due within five days of the day of the month the spreadhseet is opened.
All the tasks are on two different excel sheets though and one of them i update with different tasks 2-3 times a week.
I am trying to set up a spreadsheet which automatically calculates the start and end dates of project tasks, by looking at the order in which tasks need to be completed. I have attached a spreadsheet to show what I am trying to do.
I would like to create a menu representing "tasks" where an amount of "time" can be designated per option for my employees to select and fill. I would like this information to then be tallied elsewhere so I can keep track of our efficiency.
So far, I've created a table where a "time" input is nested beside each "task" drop down menu, I would like these inputs to be added up underneath the same category on the budget tab.
For example: If I work Monday, Tuesday and Wednesday doing tiling.. I would like the budget to reflect those accumulated hours (throughout the week) nested under "tiling".
Here's the file, what I'm trying to accomplish [URL] ............