Email Dual Sort & Find Macro - Triple Function
May 20, 2008I'm looking for a macro that can sort emails by 2 very distinct ways, with 1 special find function as well. Not too much eh? ........
View 9 RepliesI'm looking for a macro that can sort emails by 2 very distinct ways, with 1 special find function as well. Not too much eh? ........
View 9 Replies[IMG]file:///C:/Users/Paul/AppData/Local/Temp/moz-screenshot.png[/IMG]I need a fairly simple formula (I think) I have this table in another worksheet. I would like to be able to input select from a list "integrity" in A1 and from another list select "20" in A2 and then in A3 this mythical formula (if A1 = Integrity and A2 = 20, then 120%) I suppose i could write a ridiculously large if,then statement but I was thinking more of using a duel vlookup function.
View 9 Replies View RelatedI can accomplish what I want with the "Spin Button", but I'd really like to use the command button instead...
Can the command button be used for 2 functions?
Right now, I have a Spin Button, that performs this function:
Private Sub SpinButton1_spinup()
Range("E11").Formula = "=c11"
[Code]...
Is there a way to have the Command Button perform the same function? Not very familiar with VBA...I'd even prefer to go with the "Check Box"...but frankly, I simply don't know enough about the command functions to make it work.
I have a report I produce where I take an XML file, sort it and run some simple formulas then sort another way and run a few more formulas then update a pivot table. The XML files I'm using have the same headers but vary in length. When I set the macro up for a particular XML file everything works fine. When I import another one (different size) I get the error message:
Run-time error ‘1004’:
Sort method of Range class failed
When I look at the code I see that the range is fixed to the XML file I used when setting the macro up. Is there a way to auto-select the table in the macro so I can run the same macro on any size XML?
I browsed the first few pages of searching for "row delete macro" and couldn't find anything that suited my needs very much, so here goes:
What I need to do is automatically delete rows where the entries in column B (date) and column E (string) are the same. It is a very large group of data, so filtering is not exacly an option here.
Here is the twist on it...
I have a column F that contains either "Accepted-Active" or "Accepted-Closed". If I delete a bunch of rows that contain the same column B and E entries, I want to save the row that contains "Accepted-Closed", otherwise I don't particularly care which of the rows is saved.
On my worksheet I have the 6 columns below starting in A1.
The Code is an ASX code and the PE is the price earnings for each code for the past 3 years
The 3 code columns A1, C1, E1 are letters and the 3 PE columns B1, D1, F1 are numbers.
I need to match and sort these so the codes with their PE's all match so I can compare them.
Using the codes in A1 to match the rest would be ideal as this is he most recent data.
Every year new stocks are added and some deleted so none of the rows match.
Its hard to post and example so if you need more info please ask.
I have very basic vb skills and may be able to adapt some code already posted if anyone knows of some.
Code08 PE 08 Code07 PE 07 Code06 PE 06
AAC 3.4 AAC 5.5 AAC 12
AAF 6 AAE 13 AAI 3
I am trying to create a conditional/IF formula contingent on 3 different possibilities for f2, with the formula I wish to use based on these 3 possibilities, as shown below:
If f2 <=10, f2*100
If f2 >10 but f2<20, 1000+((f2-10)*50)
If f2 >=20, 1500+((f2-20)*20)
I'm not sure how to create this formula using three different conditions, especially as it is unclear to me how Excel needs to have the parenthesis placed.
ColA-ColB-ColC- Z
a1 - b1 - c1 -1
a2 - b2 - c2 -2
a3 - b3 - c3 -3
if there a formula to check all the rows,
in cell a1,
if a1=a1, b1=b1, c1=c1, it'll return 1
if a3=a3, b3=b3, c3=c3, it'll return 3
I checked the formula below, from how I read, it only check for 1 condition...
=IF(COUNTIF(db!$G:$G,nvT!E6),INDEX(db!$H:$H,MATCH(E6,db!$G:$G,FALSE),1), "0")
I'm running the following to put quotes around data in a workbook:
Sub test()
For Each s In Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
s.Value = """" & Format(s.Value, "00000000") & """"
Next
For Each s In Range("B1:B" & Cells(Rows.Count, 1).End(xlUp).Row)
s.Value = """" & Format(s.Value, "####") & """"
Next
End Sub
And exporting as a CSV file for loading into another program. The problem is everything looks OK in Excel, but when I open the file in Notepad to check the output, the quotes are all triple. How can I get only single quotes around the data?
I currently have a button then when pressed automatically sends a summary report taken from the first page of Sheet 1.
Worksheet needs to be protected all the time, but Macro only works on an unprotected worksheet.
I was wondering what additional code and where to put in so that when
protected back again after Macro has been executed?
Here’s the Macro taken from [url]
I need to sort email address list by domain name instead of just ascending and decending,
I am struggling to find a macro which can look at a name in column 'BT' and search it in the address book of Outlook to then place the email address of that person in column 'ED'
There are 35,000+ people in the address book and there may be over 5 email addresses for one name, so is there any way a message can appear for the user to select which email address is correct if there is more than 1 contact for that name?
Attached is a sample in which Column"B" contains Total IDs and Column"D" contains worked labour IDs. Now I want the IDs of labour who have not worked in Column"F".
I am using a macro to find a value in a cell and if found, replace the value in the cell to the left. Thr macro works fine - unless the value I am searching for does not exist. The answer is ( Ithink) an IF statement, but I am having problems with the errors, when I try the IF.
The macro below blows up at the ActiveCell.Offset(0, -1) = "109073X line with an error "Run-time error "1004" - Application-defines or object-defined error.
I've tried a number of things I've seen from this board but have not found a way past the error.
If the value is found, the macro moves to the else statment and stops at the ActiveCell statement with the above error. If the value is not found, then the macro goto NotFound.
Sub Macro2()
'
'Range("A1").Select 'Start from the home cell
Dim ValueFound As Object
Set ValueFound = Cells.Find(What:="Cirrus Reversals/CREDITS")
If ValueFound Is Nothing ThenGoTo NotFoundElseActiveCell.Offset(0, -1) = "109073X"'ActiveCell.FormulaR1C1 = "109073X"End If
NotFound:
End Sub
I have two sheets. One is named sheet1 where all my data is and sheet2 where all my values are. I want to do a find a replace on column N (sheet1) using the data in sheet2. Column A on Sheet2 has all the values that are found in column N and column B on Sheet2 has what the data should change to.
So for example:
Sheet1 says the following on column N:
cat
dog
lion
bear
Sheet2 says:
Column A
A1: Cat
A2: Dog
A3: Bear
Column B
B1: 2
B2: 8
B3:15
I want the values on column N to be replaced with 2, 8, 15 and so forth. I use excel 2010.
On sheet 1 I have a list of 1000 firstnames
On sheet 2 I have a list of 1000 emails,
I need a function that states If a cell in the email column contains a string or value from the names column, it will result in a true statement so that I can separate out the emails that have these peoples first names.
I am looking for a macro to sort my colums in ascending order the range i need sorted is from A7:F107, it will be sorted with the numbers in the A column ie 1 - 107. sometimes different numbers get added and it has to be sorted in number sequence.
If possible i would also like a macro to protect this range after the sort,
I'm trying to fully automate a process for my team. So far I have a main workbook that imports files to Excel and puts them into 2 reports for us.
We then copy and paste separate sheets into their respective workbooks
I am wanting to create a button for both files to be emailed from our main workbook.
The two files have the same file name every day except the date is added to the end every day in format mm-dd-yy
The two filenames will always be ABC Flash Report and DEF Flash Report.
Is there a way for to search the directory they will be in(always be the same as well) and then attach that file to an email?
I'm trying to create a macro that will find the parent folder of the active workbook, zip all files within that workbook, then email that zipped file to a distribution list that is located in a separate file within the same drive. ideally, afterwards it would also delete the zip file that had just been created. The vlookup would reference a stationary cell within each of the files i use (same tab name and cell location) 'Summary'!B2
This is the vlookup i was trying to use:
=VLookup(B2, "shared drive location[Distribution Lists.xlsx]Distribution Lists'!$B:$E", 3, False)
I know how to format a cell so that if I type 5 it will say: 5 SF And then in another cell if I type 15, it will say: 15 Units
Is there any way possible to format a cell so that if I type (its actually calculated via formulas) these two numbers in one cell that it will format them both?
EXAMPLE: One cell that has 5, 15 will read: 5 SF and 15 Units
I have a spreadsheet, in columns A & B are some numbers. I'm subtracting B from A - =sum(b1-a1) in column C. Can a formula be written, if the sum is equal or greater than 8, it will display 1? If the sum is 7 or less, it will display the sum. Or, does this need to be in a different column?
View 2 Replies View RelatedI want VBA to open two separate sessions of IE on two separate displays.
I have not been able get the display part to work and not finding anything so i am not sure if i need separate sessions but would like to do so to be safe (doing it manually on the computers using i have to have separate sessions of IE to do full screen on the two monitors).
current code: (this opens two IE windows on full screen on the default monitor)
Code:
Sub Test()
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
[Code] .........
One formula is already present in the cell to show a value or date. I also want to use a formula to populate the cell with a comment from the contents of another cell.
I know the individual formulas, but just need to know how I can use both of them to show the results in the same cell.
TAKING A BIT FURTHER THE POST Find Min Value In Multiple Columns And Match The Header
Here's my problem: I am trying to find the MIN value in a column with dual headings and match the corresponding product which makes my formula with three criteria.
see the attachment to see the structure of the tables and further explanation.
How can I turn this into a dual axis chart whereby it shows the number of current stores open (like it does right now) as a bar chart. But also as a line chart shows the store potential (%) - so for example, PSUN has 960 current stores and has a 96% store penetration rate.
View 9 Replies View RelatedI'm trying to create a macro the saves a report and then opens an email dialogue box populating the recipients from a list. I have the following code so far but the receivers are constant.
[Code] .....
I have attached a simplified example of the list. The list is always sorted by time and date. Not including headers, the list can be from 1 to an unspecified number of users long and users may repeat throughout the list any number of times.
The user name always appears as their email address prefix and the email address will always end in "@example.com".
I am aware that a loop could perform this task but do not know how to employ it in this case as it must not repeat recipients and will also need to populate the EmTo line. Possibly a second loop for this?
Attached File : Report Test.xlsx
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 Then
If Target = "" Then
Cells(Target.Row, 3).ClearContents
Else: If Target.Value = "test" Then Cells(Target.Row, 3) = my.Email.co.uk
End If
End If
Application.EnableEvents = True
End Sub
Basically, my target column is column A, i have 200 employee numbers, now we have to find the email addresses manually which is useless so i want to spend the time writing some code like:
If the target column is 123456 then the offset column D is email address
If the target column is 654321 then the offset column D value is email address.
I have 200 statements like this ill need to add unless anyone has any suggestions, perhaps select case structure?? I dont really know where to start an so i await your replies.
I have a table with a number of columns of data.
Column A cells have a text string that has a number at the start of the line.
The table is constantly adding additional results (rows) every 5 minutes or so.
Can I dynamically identify rows via the number at the start of column A and copy all cells in that row to a different worksheet?
-Problem on all workbook tabs
-Problem persists when port of worksheet data is copied to new workbook.
-New workbook with newly typed data will allow sort.
-Can't get my existing workbook sort to work.
I have a vertical list where every other cell is coloured grey. The values contained in the list are regularly sorted into alphabetical order with new values being added and other being removed.
Is there a way to keep the cells alternate grey & white after I have sorted them? Currently, when I sort, if a cell is coloured grey and is moved down one cell the colour is moved and not just the values.