Right now I and getting an "Type not defined" error and the Dim oData As New DataObject step. Also if delete the code to clear the clipboard, I get an error at the WholeStory step.
The following code opens Word correctly, but has too many tool bars open. I only want the tool bars to be opened, just like when you click on the Word Icon at the bottom of the screen. I do not want the following 3 tool bars to open . . . Drawing, Reviewing & Microsoft Office Live Add-In.
Included in the macro, I would like for the macro to open up Word, grab a label template, that I have stored (have to navigate there), and then merge the data from the excel file into the Word template.
I want to set up a one step button in an Excel workbook to open up a Word Mailmerge Document that I have already set up complete with Excel data source. I have used this code so far but it's not working. What else do I have to do?
Sub OpenWordMailmergeMasterB() Set appWD = CreateObject("Word.Application") appWD.Visible = True appWD.Documents.Open Filename:="X:Detention filesMail MergeLesley's MailmergeMASTER Interim Report.doc"
'To Run the Mail Merge 'Data source is a range name in Excel workbook called "MailmergeReport":.....................
I have a list of asset data (columns A:Z and over 20,000 rows).
I want a macro to find the word TAG in column F then cut off the entire row for all that meet the criteria and paste in another sheet. So I can see both sheets.
I am making a spreadsheet that sorts and pastes, but I need to know if I can add a code to the Sort and Paste Macro that will open the second spread sheet needed without just already having it open and using the
I would Need a macro which would Search a Keyword in the excel sheet and copies and pates the data in Cell "A2". for Example "Market" and then after the search it copies 12 rows upwards and 10 columns from the Cell that the word "Market" is placed. And then it copies 12 rows downwards and 10 columns from the Cell that the word "Market" is placed.
I have tried recording the same but it does not work if the Word "Market" is placed in different cell value.
I use an excel workbook that contains around 20-30 output tables/ranges and i would to have a macro which will enable me to open a specific word document and paste these tables/ranges from excel into the word document. I am unsure as to how to get excel and word to "talk to each other"???
To make things more difficult i would like to be able to set the paste location in the word document, and ideally i would the copy and paste function to be a normal copy and paste and not a paste special as the tables/rnage in excel have already been formatted correctly and column widths adjusted to fit the margin of the word document.
Currently I select the range in excel, switch to word and paste then continue until all tables/ranges are pasted. Not difficult but as certain calculations change these tables/ranges need to be re-copied and pasted to word which gets frustrating.
I am trying to have a macro that separates a list with unique values in column a, copy the results, open a file name in column AG, and then paste the copied stuff into the open workbook.
Currently, it runs, but when I copy to the new sheet, the thing I want goes where I want it to, but I also get an extra sheet1. how can i change this so the sheet1 doesn't get pasted in?
Sub MC() Dim r As Long, rng As Range, ws As Worksheet Application.DisplayAlerts = False Application.ScreenUpdating = False ActiveSheet.Name = "Sheet1" With Sheets("Sheet1") Sheets.Add().Name = "temp"
I have written the following code that is supposed to be running on opening a work book. The macro is being called via Application.Run "CreatePT" which is in the this workbook code in a Sub workbook_open().
The code run on its own is fine with no errors... It only bombs out when its called via application.run then its a run time error 1004? ...
What I have is a table of employees names, which site they work at and a comment.
I have a table on another sheet with the addresses of all our sites.
What I need is a macro which will: >look at the active selection >copy their name(sheet 1, row B) & comment (sheet 1, row G) >look up the site they work at (sheet 1, row D) >copy the relevant address (sheet 3) >paste the name and addresses into different sheet >paste the comments into another sheet
This will be used to make printable labels for letters that we post out to employees. They will need to be split up so each name and address is printed on a different label.
The comments will be printed onto letters which will have a headers which is the same for everyone, but would be nice if they could be personalised with the comments of their managers and perhaps their names (something like "Hi John, you have been selected by your manager for your great work, please find enclosed your badge. Jeff's comments: "Comment 1""). But this part is a nice extra, the important part is the address labels.
What I would like a macro to do is take information from cells A1 to P1 on sheet1 and add them to the table in sheet2 and then I can save the workbook. The information in A1 to P1 is taken from other cells around the workbook. Once the information is in sheet 2 I can delete or change the informtion in sheet 1 without it affecting the copied information in sheet 2.
The next time I open the workbook I can enter the information in cells A1 to P1 on sheet1 then run the macro again and will then take the information and add it to the bottom of the table in sheet2 underneath the previous information that had been added - obviously the source of this information will now be deleted.
I will need to do this again and again building up the table in sheet2. The table will also use columns A to P like in sheet1.
What I have is a list of selected employees, with the site they work at next to them.
What I need is a macro which looks at the site they work at, references it with an address table in a separate worksheet and then pastes the site address along with the employee's name onto a thrid worksheet which will be used to print post labels.
>Look at which site the employee works at (Sheet 1, D:D) >Find the address of said site (Sheet 3) >Paste the relevant address along with the employees name (Sheet 1, B:B) into a separate worksheet.
This will be done weekly, and I need the macro to either only work on the latest's weeks table, or to just work with the current active selection. Any better way to layout my table.
I've took on a task that I stupidly volunteered myself for since no one else will.. including our development or IT team will seem to get completed.
Here's my dilemma: User has information in Word that needs to go to XL WorkSheet. It has been formatted with tabs so that the information is copy and pasted into individual cells. To avoid human error, I want XL to open with a fresh workbook so that the information can be pasted into it with the Macro being run from Word.
I've searched everywhere to look for code to open XL up from Word and cannot find anything.
Will it be possible to open a new workbook and paste that information all with a macro from Word? Or will I need to trigger a macro in an already saved workbook?
I need to open a blank word doc, paste a spreadsheet onto it, format it and filter out some keywords. All from excel of course.
1) Access the internet web page - done 2) Open the excel ss - done 3) Open word - not done 4) Paste the ss onto word - not done 5) Format the doc - not done 6) Filter out rows containing keywords - not done
Just to get started I tried this code to open an existing word doc but it doesn't work
Code: Private Sub CommandButton1_Click() Set wrdApp = CreateObject("Word.Application") Set wrdDoc = wrdApp.Documents.Open("C:BShift.doc") End Sub
It says file cannot be found. There is a file there named BShift in word 2010.
know a simple code that I can use in Excel VBA to simply check if Microsoft Word is open or not? I'm not worried about checking for a specific document, but just if the application is running or not.
not sure why this is not working, it is from Access I know this is the wrong forum but figured I haven't got any answers from anywhere else and it seems like a simple fix
this command fails... i am guessing its to do with the file path having spaces but don't know how to get it to work, what to insert so it will work.
Call Shell("V:Program Files (x86)Microsoft OfficeOFFICE11WINWORD.EXE / L:Best Practice ManualFull Labour Hire Best Practice Manual.doc", 1)
I would like to open a word file in my Excel VBA code. The word document has its own VBA code that will run when Excel opens it. I do not need to move any data around I just want Excel to open my word doc.
I'm trying to write an Excel VBA macro that opens a .csv file, selects a range of cells, opens a new, blank Word document, and then pastes the cells into the Word document.
I can open .csv file.
I can open MS Word.
I can select and copy the cells in the .csv file.
I cannot figure out how to paste those cells into Word.
I have created a spreadsheet some time ago and have been asked to improve on it but I'm rusty with VBA.
I have an automated ordering system that saves each sent order as the date e.g "05-04-2013.xls" but the management team want a graph with the data for the last 4 weeks compared. I have created a seperate workbook called "consumables report.xls" which has a column with the products listed followed by columns "Quantity" and "cost" which is repeated for the 4 weeks of the month.
I want to add a button to prompt the user to choose the saved order e.g "05-04-2013.xls" (all orders saved in same directory) to copy and paste the quantity and cost columns (c8,D69) into "consumables report.xls". I got this to work earlier but it would only paste the formulas and not the values. So I need
A prompt to open workbook Copy range (c8,d69) Close work sheet Paste special .value (c8,D69)
I dont care if it has to open the workbook to copy the data as this will only be used once a month so it dosnt matter how slow the code is.
The purpose of this endeavour is to create a cell that when the user clicks on it, it will open up a Word file that THAT particular cell represents.
FIRST STEP: Take the values from Column D (Tract Number), then add a ".doc" extension to it, then put the UNC filepath (\serverdata eports) in front of all of that and put it in Column E. See me example below:
File path plus Tract Number plus Extension
\serverdata eports 7-5-065-085 .doc
.... to generate something like this: \serverdata eports7-5-065-085.doc
SECOND STEP: Use the value (only when the user clicks on the hyperlink) from the cell in Column E and start up Word.
I have a code which selects a range within my spreadsheet, copies it and then pastes it into word. The only thing I can't work out is how to get it to then return to the Excel Spreadsheet that I have open.
Sub SetPrintcopy() Dim appWord As Word.Application Set appWord = New Word.Application appWord.Visible = True ActiveSheet.PageSetup.PrintArea = "$A$1:$F$398" Range("A1:F398").Copy appWord.Documents.Add.Content.Paste End Sub
I have some excel files that use VBA to paste information into word which worked fine with older versions of Office. Now I am on a new computer with Office 2007 and everything got hosed. The file is still being created on the desktop, but now there is nothing in it. If I try to paste into notepad a blank line shows up with nothing else, however if I try to paste back into excel the data is there.
Dim appWD As Word.Application Set appWD = CreateObject("Word.Application.8") appWD.Visible = False Sheets("Calculator").Select Sheets("Template").Range("A2").Value = Range("J1").Value Sheets("Template").Range("A39").Value = Range("J20").Value Sheets("Template").Select Range("A1:A49").Copy appWD.Documents.Add appWD.Selection.PasteSpecial DataType:=wdPasteEnhancedMetafile appWD.ActiveDocument.SaveAs FileName:="C:Documents and SettingsAll UsersDesktopcans.nc", FileFormat:=wdFormatText appWD.ActiveDocument.Close appWD.Quit Sheets("Calculator").Select
I have a long list of addresses in excel. I need the postcodes to Georeference them but the addresses are all in one cell (seperate cell for each address). For instance:
Cell A1: My house, Whalley New Road, Lancashire, BB4 9TP
I need to extract the postcode ( zip code) and paste it into a seperate cell. I then need to repeat this for every address. I have had a play around but am not getting far at all. From other questions asked like this they all seem to just want to trim!