Creating email drafts with the use of VBA in excel.
I've used some of his code to create an email draft to send a particular range within my excel spreadsheet. The trouble I'm having with it is keeping the hyperlinks within each cell in the range which will take the user to a particular website. How do I keep this formatting when the range is copied into the body of the email.
Example Cell A10 = HYPERLINK("URL","Google")
The hyperlinks are lost. How to keep these? Here is the code
Sub Mail_Selection_Range_Outlook_Body()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Set rng = Nothing
On Error Resume Next
Set rng = Range("EmailRange")
I am using the following code to send emails, it's from Ron DeBruin's site. It works, but how can I edit so that it doesn't send the file, but saves it to your drafts??
I am automating Excel to send an email with a range as the body of the email. This all works fine and the email is presented before sending with the correct information.
The difficulty comes as I have a hyperlink (to intranet site) and when excel imports the data, it doesnt convert it into a hyperlink. It remains as text and hence you cannot click on it.
I have tried changing my outlook options to text and using word as editor, neither work. Has anyone else come across this issue?
In column A I have a range of file path extensions (i.e., C:UsersJSmithDocumentsModelsHic Sunt DraconesTest.xlsx). What I want is a macro that will use those file path extensions to create hyperlinks in column B.
So far this is what I have:
VB: Sub Hyperlink() Range("a1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=Range("b1").Value, SubAddress:= _ "", TextToDisplay:="Link" End Sub
This code works for the first cell, but does not work for the rest of the cells in the range. Also. Keep in mind that the range of cells in column A is dynamic - it changes in length.
I currently have a macro that uploads information on a daily basis for hours worked on campaigns per employee. It then converts the data into a pivot table where it uses relative references to copy the total from the bottom and paste them on to another worksheet. I am now trying to use hyperlinks to link the total back to the pivot table. With daily updates though, the data is constantly being pushed down and is located in a new cell each time. How can I get a hyperlink to work for an area thats constantly changing?
I want to loop through a list of numbers and add a hyperlink to each number. This hyperlink refer to a sheet with the same name as the number. how I shall use hyperlink line below. The loop and everything else is ok. I use a loop like the one below and want to refer the Hyperlink to activecell each time
I would like to set up an index sheet the will contain hyperlink to all the other sheets. Is a new sheet is added or deleted the index sheet must be updated
I am trying to place a hyperlink on each worksheet to an Index worksheet. This is what I come up with so far, and it does not work.
Code: Sub CreateIndexHyperlinks() Dim ws As Worksheet For Each ws In Worksheets ws.Hyperlinks.Add Anchor:=ws.Range("H1"), Address:="", SubAddress:="Index", TextToDisplay:="Back to Index" Next ws End Sub
It successfully puts the words "Back to Index" into cell H8 of every worksheet, but this cell does not link back to the Index sheet (which is called "Index"), the way I want it to.
I don't really understand the Address and SubAddress part of the argument for the Hyperlinks.Add method. I am guessing the Address part is "" because I am linking to a place in the same workbook. Is that right?
I tried changing the SubAddress to Worksheets("Index") and Worksheets("Index").Range("A1") but that just resulted in an error message.
I am trying to further automate the process of formatting my financial statements and am hoping someone might get me on the right track here. Currently I create 2 sheets, one called "MMM YYYY" (i.e. month year) and another called "General Ledger".
The process I am currently doing manually is creating a link between each line item on the financial statement and its GL account information on the General Ledger tab.
The description of each line item on the financial statement (the MMM YYYY tab) matches the GL account description on the General Ledger tab with the exception that the GL account description starts with the GL account number and then the description.
For example the "Utilities" line item on the financial statement needs to link to a line on the General Ledger tab that is "7071-45 Utilities".
In my mind I see the macro saying go to the next line and read what it says. Now go to the General Ledger tab and look for something that says the same thing excluding any preceeding numbers and make a hyperlink.
If it helps, I've uploaded a sample of one of the statements as I currently do them with the hyperlinks already set up. There are not any macros in this spreadsheet. If you'd like to take a look at it, you can get it here: ....
I have a list of file names sans extension in column A. I want to search a folder I specify and if file is found create a hyperlink to said file either in a new cell or in column A.
The code I have does the search fine, but its hyperlinking is offset and I can’t get it to match the link to the file name.
I tried to learn VBA about 4years ago, so my knowledge as died. I hope this question has not come up before, i did do a search before. I wish to create a new hyperlink based on a activecell eg. A1=SN0001 then hyperlink will be SN0001. Only thing i can remember how to do is record marco, but ofcourse copying the cell will return a hardcoded value.
I need to make a Workbook that has hyperlinks in the first sheet that links to a cell in a second sheet and then back again. The only way I have been able to do this is manually create each link in each sheet. I am hoping that this process can be automated as they can not be 'filled' as far as I can see. find attached an example of what I am trying to achieve.
Can't seem to attach sample Widgets.xls. I need a macro to take the heading (note heading not sheet name) from each worksheet on a workbook (or from a range of nominated worksheets in case I don't want to index the first or last few sheets) and use it as the Description for a Index entry on a nominated sheet e.g. Sheet named 'Index'. In addition that each Description is also a hyperlink back to the sheet with the heading. In this way users can click between each entry on the index to go to the sheet and then click on the heading on the sheet to go back to the index.
Index Sheet
M21, M22 and M22-A BICYCLES1 Q21, Q22 and Q22-A BICYCLES2 R21, R22 and R22-A BICYCLES3
Taking this one step further I ideally want to save this workbook as a pdf and the hyperlinks to remain.
I have two sheets. Sheet A has a list of folders. This list is updates dynamically every time the sheet is opened. I have another sheet (sheet B) which has a list of all the files in the sub-folders, listed with the folder name at the top of the column and the files within in the column underneath with hyperlinks to them. The goal is to be able to navigate to the folders on sheet A and to click there to go to the column where all the files in that folder are linked to. What I need is a macro that will search a column and for every cell that has text in it and create in the column directly to the right a hyperlink to the appropriate cell in the top row in sheet B that has the same name as the text in the cell on sheet A that it finds. I already have the macros for listing the folders on sheet A and the macro for listing all the files in the sub folders in sheet B and they work fine. The goal is a link list which is dynamic and that recreates itself no matter what I add to the folders.
For instance, let’s say there is a folder timesheets. If I add a sub-folder called accounting to the folder Sheet A scans then timesheets would be bumped down one spot on the list, so the macro has to look dynamically for the text in the column on sheet A.
Also the addition of the new folder would move the order of the columns on sheet B, since both lists are alphabetical. So the link generation macro would need to search row 1 of Sheet B to find the match for the text in the cell to the left of where the link would be generated and create a link to the top of that column. I’ve looked all through the site and not found something that I can even modify to do what I need.
I have a sheet using VLookup to find EMail and Web addresses. I can get the address to show up but not as an active URL address. Is it possible to have the address "active" so I can click on it and activate the EMail or Web Site?
I'm having trouble writing a forumla that will grab a second player from a list.
For example, there are 3 possible QB spots. I need a formula that will grab the 1st QB, the second QB if a 1st has already been selected and a 3rd if a 2nd has already been selected. This is what I have but it's not working right.
I've got an excel master roster sheet filled with youth hockey player info and stats. Fields are in columns, and a couple hundred rows of players. What I'm planning to do use this info for a spring teams draft. I've got a blank field/column ready to write in the team names to which each player will be drafted.
What I'd like to do is have several other 'team pages' in the excel workbook that first look through the master roster sheet, checking for a matching team name. Next, those team pages would populate themselves with all the player information on the master sheet, provided the team name matches. Basically I want to have the rosters created automatically rather than doing any autofiltering after.
I did try a VLookup function, but it would only pull the first matching record, and nothing after.
I have a complex sorting macro with userforms & Modules. Works great! Now I need to save the final Worksheet without the macros. The final step to my project is a Application SaveAs. Can I add a delete-all-macros step when the user clicks the Save As button which would create a new workbook with the finished worksheet and NO macros?
i have many excel workbooks in a folder i want a macro that will get the names of all the files and make the file names so extracted as a hyperlink to open the files.
Anyway if its possible...i need to create a button in my worksheet, such that when one clicks it, it'll compose an email thru Outlook; outputting a specific range as the body of the email.
I have an excel file that will be downloaded by multiple users and saved locally. I was wondering if there was a way to build code into the file so that everytime it is saved an email would be created in lotus notes from the user to me with a copy of the file attached. Is this possible?
I'm generating a letter (Word doc) and populating bookmarks with data on a worksheet using the following code which is assigned to a Button and it works a dream (in terms of opening the Doc and populating the bookmarks with whatever data is in the relevant cells on the worksheet):
Sub test() Dim objWord As Object Dim ws As Worksheet Set ws = ThisWorkbook.Sheets("Sheet1") Set objWord = CreateObject("Word.Application") objWord.Visible = True objWord.Documents.Open "location of the letter.doc"
[code]......
However, what I now need to do is Create an Outlook Item (email) with a Standard Subject and send to an email address that will be on the same worksheet (in cell M2 for instance) and with a standard Body.
I dont really need to open the Word doc, like it does at present, but I do need the Bookmarks contained within it to be populated with the source data contained within the Worksheet and subsequently have it attached to the email fully populated - maybe I need to 'close' / 'save as & close' the Doc post generation?
a formula to create an email address. The person's name is in cell A1. The email addresses are all the last name + first initial followed by @ and the domain name. For instance, if name is John Doe, the email address would be doej@emaildomain.com.
The problem is, some of the names in the list contain middle initials, so I can't figure out a reliable way to discern the last name.
I know I can create a custom function in VBA using InStrRev to separate the last name, but if there is a way to do it using the functions already available in Excel, I'd rather do that.
I am working on a project. As part of project, emails were sent out to an experimental group for a cost survey. I have to combine data and do analysis now. I am given two excel spreadsheets (sample of both attached).
In sheet 1, column B contains email name. For instance, first email name (Row A2) is ‘96 '07 Bustello Third email name (Row A4) is 90-pt Panda Express '10
Based on this email name, I need to create a new column that contains only company name i.e Bustello against row A2, Panda Express against Row A4 and so on.
I thought of using ‘Text to Column’ function in the beginning. However, since there is no common character in all email names and no fixed width at which company names are embedded in email name I could not use it.
For now, I am doing it manually. I have 10,000 email names and it is becoming hard to do it manually.
Although I am given another sheet (sheet 2 of sample), which has two columns: Company number and Company Name, there is no common variable that I can use to do VLOOK UP therefore; I am not sure how to make use of that sheet.
I would like a macro that recognises the cell colour in column F if it is yellow i would like a standard email to be created & sent to the corresponding customer email address in column D. is this even possible??
I need to email a page from a worksheet to a series of people and am currently using the following
Worksheets("Report").Activate ActiveWorkbook.Save
Dim wb As Workbook Dim strdate As String strdate = Format(Now, "dd-mm-yy h-mm-ss") Application. ScreenUpdating = False ActiveSheet.Copy Set wb = ActiveWorkbook With wb
however, I also need the worksheet to be email to the person currently running the macro (i.e. when they email it to the others, a copy is sent to thier own inbox too), is there any way in which this can be done?
The user's email address could be formed from data in the spreadsheet, if there is an easier way to do this (i.e. email address is based on a cell in the spreadsheet).