Use Do Until to break links

Size: px
Start display at page:

Download "Use Do Until to break links"

Transcription

1 Excel magazines, seminars, add-ons, support and bespoke Excel Systems Edition 0 January 00 IN THIS EDITION Use Do Until to break links Edition 0 Jan 00 >>Files: BreakLinks.xls, AusData.xls, NZData.xls Back to top. Use Do Until to break links. Split to several sheets by changes in column. Editor's letter. AbleOwl Information. Copy multiple files. Delete sheets whose names contain certain text 9. Filter dates with care 0. Save a copy of an Outlook attachment Excel prompts to update links in formulae when you open a spreadsheet File: BreakLinks.xls, sheet: sdata Most readers are probably familiar with the often-unwanted prompt to update links when you open a spreadsheet. You see the prompt when cells contain formulae that have links to cells in other spreadsheets, as shown here. Here is a macro, from the Internet, that breaks links alinksarray is an array of the linked filenames. BreakLink replaces a link Suppose that you want to replace (as current values) all cell formulae that contain links. One of our hotline customers presented us with the macro below (from an Internet source): Sub BreakLinks() Dim alinksarray, alinkno alinksarray = _ ActiveWorkbook.LinkSources(Type:=xlLinkTypeExce llinks) If Not IsArray(aLinksArray) Then Exit Sub For alinkno = LBound(aLinksArray) To UBound(aLinksArray) ActiveWorkbook.BreakLink Name:=aLinksArray(aLinkNo), _ Type:=xlLinkTypeExcelLinks Next alinkno The macro creates an array of all formula links in the active workbook (line ). If there are no links, alinksarray is not an array, and line causes the macro to exit. Line begins a loop that repeats for each of the links in turn. alinkno counts from the lower boundary of the array (first subscript) to the upper boundary. Line then uses the BreakLink method to replace each formula with its current formula result. AbleOwl (SEY) Ltd 00

2 The BreakLink method fails for the example file The line fails when BreakLink tries to remove the NZData.xls link That is all very well, but unfortunately the macro does not quite work when run for the example file. The macro produces the fairly-unhelpful error message shown on the right. A click of the Debug button highlights the line that causes the error (shown below). With the mouse pointer over the alinksarray variable name, you can see the link that the line attempts to remove. Cell L contains only a value at this point The loop ran once and removed one link, then failed because the second link was gone The macro needs to update the array Meanwhile, back at the spreadsheet (shown on the right), you can see that cell L now contains the value, rather than the formula shown previously. Can you see what causes the error? The macro loop runs once correctly and removes the link to the AusData.xls workbook. Then, the loop repeats for the second link in the array (the link to NZData.xls). However, although the array has not changed, the spreadsheet no longer contains a link to NZData.xls. Therefore, the BreakLink method fails. The macro needs to update the array each time the BreakLink method removes a link. Here is an alternative macro that solves the problem: Do Until repeats only until there are no more links to remove Sub BreakLinks() Dim alinksarray As Variant alinksarray = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks) Do Until IsEmpty(aLinksArray) ActiveWorkbook.BreakLink Name:=aLinksArray(), Type:=xlLinkTypeExcelLinks alinksarray = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks) Loop Again, alinksarray is an array variable that contains the filenames for links in the active workbook. But this time, the Do Until loop (that begins at line ) repeats until there are no links. Line then breaks only the first link, specified by alinksarray(). Line updates the alinksarray, and the loop repeats. Split to several sheets by changes in column >>Files: SplitByColumn.xls A customer needs a macro to look through data and spot the changes Back to top Justin, from the UK, writes: "Is it possible to write a macro that looks at the data in column B and each time this data changes, cuts and pastes the data (i.e. the whole row/s of data) to another worksheet, and repeats this for every change of name in column B?" The example data is shown on the next page (column B has become column L). There are two macros in our solution. The first prompts for various ranges and splits the data by changes in a column Normally, we would not write such a macro from scratch for a hotline reply. However, since Justin provided an example spreadsheet and a clear description of the macro task, we felt generous enough to whip up a quick macro (or two). The macros in this article have a few additional refinements: the first macro prompts for the titles, data range, and the column to split, and also checks that the data is in sorted order. AbleOwl (SEY) Ltd 00

3 Here is the first prompt for the heading cell selection The prompt allows selection by mouse or keyboard The picture below shows the example data (on sheet mdata) and the prompt that appears when the macro runs. There is a second prompt for the data range (here, row downwards), and a third prompt for a cell in the column to split (here, any cell in column L). The prompt allows a user to use keys or the mouse to select the cell range. The second macro pastes data to new worksheets File: SplitByColumn.xls, sheet: mdata The second macro then creates a worksheet for each unique value in the column to split, as shown below for the rows of the Walsall branch. The macro pastes both the headings and the data cells. The column to split must have identical values together, not scattered Note that the column to split by (column L) should be sorted, or at least arranged with identical values together (as shown in the first picture above). If the column to split is not in sorted order, a fourth prompt asks whether to sort the data before the macro runs. Continued next page Editor s letter Back to top To kick off the new year, I have chosen a range of straightforward macro solutions for this edition (though the last page holds a special surprise). Loops through worksheets and cells blend with an AutoFilter and even with the use of other object libraries. Mastery of these techniques will equip you to deal with any situation provided that situation deserves a macro, of course! If you have not also received a PDF copy of this edition, subscriptions@ableowl.com. Due to popular demand and favourable reader-survey results, this magazine will soon be distributed solely in PDF format, with some PDF back editions provided at changeover details next month. Alex Shepherd AbleOwl Information Website: To get a copy of the magazine files, go to Publications, Visual Basic Sheet and Download files. The download username and password for this edition 0 are mag0 and tiger. support: hotline@ableowl.com Tel: UK/Eire: () 9 9 NZ: () 00 Aus: () 9 ZA: () 0. Copyright of AbleOwl publications is owned by AbleOwl (SEY) Ltd. AbleOwl (SEY) Ltd 00

4 Here is a process summary Here is a summary, written in pseudocode, of the macro process: Actual code follows Ask for selection of the title cell range, the data range, and a cell in the column to split by If the column to split is not sorted Ask whether to sort; if so, sort the data range by the column to split Find the number of the column to split within the data range For each row of the data range Keep track of the first row to copy If the split column cell in the current row is different to that of the first row Run a macro to copy the titles and a batch of rows from the start row to the end row Reset the start row and end row to be the current row Else Set the end row to be the current row Next row Run a macro to copy the last batch of rows Here is the actual macro code: Sub SplitByChangeInColumn() Dim atitlerange As Range, arow As Range, adatarange As Range Dim acolcell As Range, acolno As Integer, astartrow As Range, aendrow As Range On Error GoTo lendofmacro: Set atitlerange = Application.InputBox _ ("Select the heading/title cells (not data cells):", "Select titles", Type:=) Set adatarange = Application.InputBox _ ("Select data cells:", "Select data range", Type:=) Set acolcell = Application.InputBox _ ("Select any cell in the column to split by:", "Select column to split", Type:=) On Error GoTo 0 acolno = acolcell.column - adatarange.column + If Not RangeIsSorted(aDataRange, acolno) Then If MsgBox("Sort data first?", vbyesno + vbquestion) Then adatarange.sort adatarange.cells(, acolno) 'Sort by the column numbered acolno For Each arow In adatarange.resize(, atitlerange.columns.count).rows If Intersect(aRow, atitlerange) Is Nothing Then 'Skip the titles row(s) If astartrow Is Nothing Then Set astartrow = arow 'Start at the first row If arow.cells(acolno) <> astartrow.cells(acolno) Then 'If cell values differ CopyRowsToNewSheet atitlerange, astartrow, aendrow, acolno 'Copy rows batch Set astartrow = arow 'Start the next batch at the current row Set aendrow = arow 'Finish the next batch at the current row Else Set aendrow = arow 'Update the end row of the next batch Next arow CopyRowsToNewSheet atitlerange, astartrow, aendrow, acolno 'Copy the final batch of rows lendofmacro: Most variables store only cell ranges All but one of the variables defined by lines and has Range type, which means each can only store a reference to a cell range. acolno is an integer (whole number) variable. The InputBox method allows selection of a range due to Type:= There are three separate InputBox statements The RangeIsSorted macro (not shown) returns True if a numbered column is in sorted order Line means that any error causes macro execution to jump to line. Unlike the usual InputBox statement, the InputBox application method (used in line ) returns a range reference when the Type:= argument is (as here). Set assigns the range reference to the atitlerange object variable. However, if the user clicks Cancel, the InputBox method returns False. The Set statement then causes an error, but due to line, the macro finishes harmlessly. Lines and again use the InputBox method to obtain references to the data range and a cell within the column to split by. The second argument in each line is the dialog box title. In line 9, the column number is the calculated difference between the column of the chosen cell acolcell and the first column of adatarange, plus. Line 0 runs a separate macro, RangeIsSorted, whose code is not shown here. There are two arguments: (a) Data range. (b) Column number (within the data range) to check. The macro returns a True value if the specified column is in sorted order. AbleOwl (SEY) Ltd 00

5 If the column is not sorted and the user clicks Yes, line sorts the data range If the column to split is not sorted, and the user clicks Yes to the MsgBox prompt (shown below for the second example data range), line sorts the data range. The first argument of Sort is the cell in the first row and the column numbered acolno. Line begins a For Each loop through the data range rows Line checks that each row does not overlap titles Line checks for a match between the starting row and the current row Where cell values differ, line 9 runs the second macro to copy the rows Where values are the same, the loop continues Line copies the final rows Line begins a loop that processes rows of the data range. arow represents each row in turn. Also in line, Resize returns a range that has an unchanged number of rows (the same as adatarange), but the same number of columns as atitlerange. The matching number of columns is important later, when macro code copies both ranges together. Provided arow is not part of the titles range, Intersect at line returns Nothing, and execution continues to line. This is just in case a user selects titles as part of the data range. The first time around the loop, astartrow has no value; line causes astartrow to represent the current row (the first row of data cells). Line checks whether a single cell within arow (at the acolno column) matches a cell in the same column of astartrow. If the cell values of arow and astartrow differ, line 9 runs a macro (shown next) to create a new sheet and copy a batch of rows from astartrow to aendrow. At line 0, the current row then becomes the start of the next batch of rows, and also the end (line ). If the cell values of arow and astartrow are the same, line simply updates aendrow to represent the current row. aendrow therefore moves down the data range as the loop repeats. After the arow loop finishes, there is still one last batch of rows to copy; line achieves that. The following separate reusable macro copies rows The code of the second macro, shown below, could have been included in the first macro, but that would make the first macro very long. Also, it would not be easy for line to run the same code as that used within the loop. Sub CopyRowsToNewSheet(aTitleRange As Range, astartrow As Range, aendrow As Range, acolno) Dim asheet As Worksheet, asheetname As String Set asheet = ActiveSheet 'Keep track of the active sheet Union(aTitleRange, Range(aStartRow, aendrow)).copy 'Copy titles and data rows together Worksheets.Add After:=Worksheets(Worksheets.Count) ActiveSheet.Paste asheetname = asheet.name & "-" & astartrow.cells(acolno) 'Construct the sheet name On Error GoTo lsheetexists: ActiveSheet.Name = asheetname 'This causes an error if the sheet exists On Error GoTo 0 Selection.Columns.AutoFit 'AutoFit column widths asheet.activate 'Activate the previously-active sheet Application.CutCopyMode = False 'Clear the clipboard Exit Sub lsheetexists: If MsgBox("Replace existing " & asheetname & " sheet?", _ vbyesno + vbquestion) = vbyes Then Application.DisplayAlerts = False Worksheets(aSheetName).Delete Resume Else Resume Next There are four arguments The four arguments are: (a) Range of title cells (headings) to copy. (b) First row range to copy. (c) Last row range to copy. (d) Number of the column that provides sheet names. AbleOwl (SEY) Ltd 00

6 asheet is a reference to the originally-active sheet Union joins the title cells to the row cells, and therefore creates multiple-area ranges Paste delivers the multiple areas to the new sheet, without gaps Line 9 derives the sheet name from the data sheet name joined to a cell value Line adjusts column widths automatically, while line reactivates the data sheet A future article shows how to catch invalid sheet names Each time the macro inserts a new sheet, Excel activates that new sheet. The object variable asheet (line ) keeps a reference to the active sheet when the macro begins. Union, in line, is a particularly interesting function. It returns a range that includes the cells of both ranges supplied as arguments: here, the titles range and the batch of data rows to copy. When the data rows are not directly below the titles, the result of the Union is a multiple-area (non-contiguous) range. Even more interestingly, the Copy method will only copy a multiple-area range when all areas have the same number of columns. Line adds a new sheet at the position after the last existing sheet. Line performs a Paste to the new sheet. It is important to use Paste and not the PasteSpecial method of a range. Because the copied range may have multiple areas, PasteSpecial may include the blank rows between the titles and the data rows, and that is undesirable. The sheet name (asheetname) comprises the original data sheet name joined to a cell value from the column to split. Line 9 attempts to set the sheet name; if the attempt fails, the macro assumes that the sheet already exists. The error diverts execution to line, and the macro displays a Yes/No message box. If the user clicks Yes, line suppresses the Excel confirmation prompt before line deletes the existing sheet. Line 9 returns execution to line 9. If the user clicks No at the message box, the macro continues from line 0 and the new sheet is not renamed. Line automatically adjusts the widths of the selected columns (the Paste leaves the pasted data selected). Line re-activates the source data sheet, and line clears the clipboard. The macro then finishes at line. If the split data column contains characters invalid for sheet names, the message box gives a misleading message that the sheet already exists. Instead, line could be modified to use a function that removes the invalid characters. Such a function is the topic of a future article. Copy multiple files >>Files: CopyMultipleFiles.xls This article shows how to have a macro copy multiple files into a subfolder within the folder of the macro workbook. There had to be a way to copy files, but John could not remember how Back to top Many readers will probably know this feeling a mix of déjà vu and mind-gone-blank John from Australia knew there had to be a way to copy all files from a folder, but could not remember how to go about it. Does a macro copy and paste the folder? Or, can a macro loop through all the files? Or, is there a single statement that copies all files? The FileCopy statement copies only one file at a time Visual Basic includes a FileCopy statement, which is very simple to use. There are only two arguments: (a) Source path (drive and directory) and filename. (b) Destination path and filename. Unfortunately, the simplicity is also a drawback; FileCopy copies only one file. You cannot use wildcards, such as *.xls* to copy all Excel files. Here is one solution 9 0 Dir returns the first matching filename to afilename in line There are two possible solutions. Here is the first: Sub CopyFiles() Dim afilename As String afilename = Dir(ThisWorkbook.Path & "\*.xls*") Do Until afilename = "" 'Dir() returns "" when there are no more files On Error GoTo lcopyfailed: FileCopy ThisWorkbook.Path & "\" & afilename, _ ThisWorkbook.Path & "\Backup" & afilename afilename = Dir() 'Dir() (without path) returns the next file Loop Exit Sub lcopyfailed: MsgBox "Cannot copy " & afilename, vbexclamation Resume Next The afilename variable receives a text filename from the Dir function in line. Dir returns the first filename that matches the wildcard (or filename) supplied as the function argument. Here, the wildcard specifies all filenames that include.xls. The directory is the same as that for the macro workbook (ThisWorkbook.Path). AbleOwl (SEY) Ltd 00

7 There is error trapping for when FileCopy cannot copy an open file Dir returns each remaining filename at line The Do Until loop, which begins at line, repeats until afilename is "". The error trapping at line causes line to display a message when the FileCopy statement (line ) cannot copy a file. For example, FileCopy cannot copy the macro workbook, because that file is open. At line, afilename receives the name of the next matching file (or "" if there are no more files). The loop repeats. Here is a second solution The CopyFile method requires a FileSystemObject reference, created by line Here is the second solution. It utilises a FileSystemObject, represented as variable afso: Sub CopyFilesFileSystemObject() Dim afso As Object Set afso = CreateObject("Scripting.FileSystemObject") afso.copyfile ThisWorkbook.Path & "\*.xls*", _ ThisWorkbook.Path & "\Backup\" & afilename The FileSystemObject type is made available by Windows as part of the Scripting Runtime Library; the Visual Basic Editor needs no permanent reference to make this macro work. Line creates the necessary reference when the macro runs. The CopyFile method is straightforward and has two arguments; the first (source) supports wildcards. It even copies files that are open! Both macros assume that the Backup directory exists Note that both macros assume there is a directory named Backup within the directory of the macro workbook. You may like to have the macro create the directory use the MkDir statement but that fails when the directory already exists. >>Files: DeleteSheets.xls Delete sheets whose names contain certain text This article develops a simple macro to delete sheets whose names include 'Sheet', or other text. A reader needed to delete 'small' worksheets Back to top An In-depth Excel Sheet subscriber asked: "What code can I use to delete all worksheets that don t have small?" It turned out that the word 'small' was included in worksheet names! Consider the need to delete drill-down reports on sheets named 'Sheet', 'Sheet' As a slightly-less cryptic example, consider a workbook in which other people double-click cells within PivotTables, and Excel adds drill-down reports (as shown below) on Sheet, Sheet, and so on. You wish to have a macro delete all sheets whose names begin with 'Sheet'. Excel cannot record a loop, but it is simple to write File: DeleteSheets.xls The macro requires a loop, which Excel cannot record. Fortunately, it is the work of a mere minute to write the macro: 9 Line is only required if there is Option Explicit at the top of the module Sub DeleteSheetsWithNamesThatBeginWithSheet() Dim asheet As Worksheet For Each asheet In Worksheets If Left(aSheet.Name, ) = "Sheet" Then asheet.activate asheet.delete Next asheet The macro name in line is a little on the verbose side, but it pays to be clear. Line is necessary when Option Explicit appears at the top of the module (not shown here): Dim defines a variable. As Worksheet means that the variable may only represent a worksheet; that helps you to spot the error if code mistakenly attempts to put something else into asheet. The For Each loop repeats for every sheet Line begins a For Each loop. The loop repeats for every sheet in the Worksheets collection. The asheet variable represents each item of Worksheets, and as you might expect, each item is a Worksheet object! AbleOwl (SEY) Ltd 00

8 When the sheet name starts with "Sheet", line activates that sheet A confirmation prompt appears before deletion Line uses If and Left to test the leftmost characters in the Name property of asheet. Where those five characters match "Sheet", line activates the sheet that asheet represents. That allows the user to see the sheet that the macro is about to delete. Line deletes the sheet, but Excel displays the confirmation prompt shown on the right. The user therefore has the chance to click 'Cancel'. Sheets are processed left-toright You can avoid the prompt, at line, marks the end of the code that runs when the If test is True. Line causes the loop to repeat for the next sheet. The sheets are processed in left-to-right order. If you do not want the confirmation prompt to appear, replace line with: Application.DisplayAlerts = False If the prompt does not appear, Excel performs the default action (in this case, to delete) This alternative line suppresses the display of certain Excel confirmation prompts, including the one that appears before Excel deletes a sheet (other examples include the Save Changes prompt and the Save Clipboard prompt). Excel performs the default action, which in this case is 'Delete'. The confirmation prompts remain suppressed until the macro finishes. To re-enable the prompts before the macro finishes, use Application.DisplayAlerts = True. You can have the code run automatically before a save Add an event procedure to ThisWorkbook If you want the code to run automatically any time that Excel saves the workbook, use a Workbook_BeforeSave event procedure. Do the following: () Double-click ThisWorkbook in the Project Explorer, as shown on the right. () Choose Workbook from the left drop-down list above the code window (shown below). A default Open event procedure husk appears. Husk may not be a technical term, but its use is common! () Choose BeforeSave from the right drop-down list. The BeforeSave event procedure appears. () Select and delete the Open event procedure. () Include the name of the relevant macro. A useful shortcut is to type DeleteSheets, then press Ctrl+space. That completes the name. You can search for text If you want to search for text (such as "small") anywhere in the sheet name, replace line with: If InStr(, asheet.name, "small", vbtextcompare) Then InStr returns the position at which "small" occurs within asheet.name (zero if not found) InStr returns the position at which that text occurs within other text, or zero if the text does not occur. An If test treats zero as False, so you can use InStr as the test condition. There are four arguments: (a) Optionally, the position at which to start searching for matching text. (b) The text to look in. (c) The text to look for. (d) Optionally, whether to perform a case-sensitive search (the default if left off), or whether to match text regardless of case (vbtextcompare). Strangely, if you specify the fourth argument, you must also specify the first Although arguments (a) and (d) are both optional, you must provide a value for argument (a) if you choose to provide a value for argument (d). Or to put it another way, you can leave off argument (d), but you cannot leave off argument (a) if there is an argument (d). AbleOwl (SEY) Ltd 00

9 >>Files: FilterDates.xls Filter dates with care This article demonstrates an inconsistency that arises when a macro applies an AutoFilter to a range of date cells. You might have a macro that applies a filter to a range of date cells The filter needs to show only dates after //00 In this article, we do not mean to advise on how to pick a date, or how to reject proposed dates (however romantic they may sound). Instead, we consider the task of having a macro apply a filter to a range of cells that contain a continuous sequence of dates. The example spreadsheet is shown on the right. File: FilterDates.xls, sheet: mbookings Back to top Suppose that today's date is the th of January a frightening date for your author (born in 90). A macro needs to filter the named range dtibookings to show only the rows that have a date after //00. If you record a macro to apply such a filter, what code do you get? Follow these steps to record the macro shown below The following steps produce the macro code shown below: () Open the example file FilterDates.xls. () Choose Tools Macros Record new macro, or (in Excel 00) Developer ribbon Record Macro. Click OK to start recording a macro (of any name) into this workbook. () Choose the name dtibookings from the Name Box. () Choose Data Filter AutoFilter, or (in Excel 00) Data ribbon Filter. () Click the drop-down arrow next to the Date heading. Enter the date criteria Find the macro below () In Excel 00, click Custom, then select 'is greater than' in the drop-down list, and enter the date //009 within the dialog box. In Excel 00, click Date Filters After, and enter the date //009 in the dialog box. Click OK. The filtered list should appear as shown on the right. () Stop recording, then open the Visual Basic Editor (Alt+F) and find the macro below: The Goto method activates the sheet that contains the named range Sub FilterDates() ' Macro recorded //009 by Alex Shepherd Application.Goto Reference:="dtiBookings" Selection.AutoFilter Selection.AutoFilter Field:=, Criteria:=">/0/00", Operator:=xlAnd Line selects the cells of the named range. You might use Range("dtiBookings").Select to do that. Application.Goto is a better solution in this case, because Goto also activates the sheet that contains the named range, and therefore ensures the filtered list is visible. Line applies an AutoFilter to the first column of the range, with a simple criterion Turn the AutoFilter off before you test the macro Line activates AutoFilter drop-down arrows (or removes an existing AutoFilter), and line applies the AutoFilter. The two arguments of the AutoFilter method are: (a) Column number to filter, where the column numbering is relative to the first column of the range that AutoFilter acts on. (b) Criteria in this case, one criterion only to specify which rows to display. () To test the macro, first choose Data Filter AutoFilter or Data ribbon tab Filter, in the Excel window. This turns the AutoFilter off, to prove there is no cheating when the macro turns on the AutoFilter. (9) Choose Tools Macro Macros, or Developer ribbon Macros, and select the macro that you recorded (e.g. Macro). Click Run. AbleOwl (SEY) Ltd 00 9

10 The macro does not apply the AutoFilter correctly Surprisingly, when the macro runs, no dates appear. What has happened? (0) Alter the criteria as shown below: Selection.AutoFilter Field:=, Criteria:=">/0/00", Operator:=xlAnd The criteria works if the date is supplied in mm/dd/yy format () Test the macro again. The criteria have to be specified in a US date format (mm/dd/yy). This is more of a problem than it first appears. Suppose you wish to show only dates after today's date; you might try: Selection.AutoFilter Field:=, Criteria:=">" & Date, Operator:=xlAnd The Date function does not work unless you convert the result to a number But that does not work, unless your Windows Regional Settings are set to provide a mm/dd/yy date format. The Date function returns an actual date value in the default Windows date format. A workaround is to use CLng (Convert Long) to convert the result of Date to a number: Selection.AutoFilter Field:=, Criteria:=">" & Date, Operator:=xlAnd What about when the date is in a spreadsheet cell? The cell value is wrong Now suppose you have today's date in a cell, such as the named cell ddate in the example file. The line below does not work, because again the cell value is in the wrong format: Selection.AutoFilter Field:=, Criteria:=">" & Range("dDate"), Operator:=xlAnd Use the Value property One solution is to use CLng again but a more interesting solution is to use Range("dDate").Value. The Value property returns a raw number instead of a date type. Save a copy of an Outlook attachment >>Files: AttachmentFromOutlook.xls This article develops a macro that finds an attachment within a selected Microsoft Outlook Inbox. Our customer's macro relied on having colleagues open the correct attachment Back to top A customer had a macro that imported data from a user-chosen source data spreadsheet. The source data was regularly ed to her colleagues. Sadly, those same colleagues occasionally failed to choose the correct source workbook for the macro to open. Sometimes, the macro would open an old copy of the data file, and import the wrong data. Or, if the attachment was never saved, there was no data file to open at all. The question was, can a macro find the Outlook attachment folder? In the picture, you can see the folder name for a particular PC The question was a red herring, because attachments may not be saved at all The question we were asked was: "Outlook attachments seem to be in a cryptically-named folder within Temporary Internet Files. How can a macro find the folder name?" As an example, the Security Warning prompt on the right shows the folder name TFY0R9J for a double-clicked attachment on this PC. Sometimes, we receive a question that, through no fault of our customer, turns out to be a red herring! This was one such case. If a user does not save or open the attachment, the file does not exist anywhere in the Temporary Internet Files folder or subfolders. Therefore, it is no use for a macro to look in that cryptically-named folder. 0 AbleOwl (SEY) Ltd 00

11 Our macro finds the attachment in the Outlook Inbox Dim mfilefound As Boolean Dim mtotalitemscount As Long Instead, the solution is to have a macro process the messages in the Outlook Inbox, and find the attachment that has a specified name. As usual, the macro published below has a few minor improvements over the one sent as a hotline answer: Sub oagetattachment() Dim afilename As String, aoutlook As Object 'If reference in place, Outlook.Application Dim ans As Object, afolder As Object 'Outlook.Namespace and Outlook.Folder Dim aitemsdone As Long afilename = InputBox("Enter attachment name to find in Outlook s:" & vbcr & _ "(choose Inbox or other Outlook folder in the next dialog box)") If afilename = "" Then Exit Sub On Error GoTo loutlooknotinstalled: Set aoutlook = CreateObject("Outlook.Application") Set ans = aoutlook.getnamespace("mapi") On Error GoTo 0 Set afolder = ans.pickfolder If Not afolder Is Nothing Then 'If the user clicks Cancel frmprogress.prgbar.value = 0 'Reset progress bar on UserForm frmprogress.show mtotalitemscount = 0 oagettotalitemscount afolder 'Run a separate macro to count items in folder(s) oasearchthroughitems afolder, afilename, aitemsdone 'Run a separate macro to search Unload frmprogress Else mfilefound = True 'If the user does not pick a folder, avoid the 'not found' message If Not mfilefound Then MsgBox "Attachment not found.", vbexclamation Set aoutlook = Nothing Exit Sub loutlooknotinstalled: MsgBox "Outlook reference failed: perhaps Outlook is not installed.", vbcritical Module-level variables retain values for a second macro to use The macro is pleasantly short because there is a second macro lurking on the next page. Module-level variables, mfilefound and mtotalitemscount, retain values after the first macro finishes. Variables within the macro are a generic Object type, so there is no permanent reference to the Outlook object library. That allows the macro to work with all Outlook versions. The InputBox is for testing or utility use There is error trapping in case Outlook is not installed GetNamespace provides access to the Outlook data for the logged-on user A PickFolder property displays a dialog box and returns the chosen folder There may be subfolders within the chosen folder A UserForm, shown overleaf, has a progress bar You may want to replace the InputBox (of line ) with a specified filename. The InputBox is useful for testing or general utility purposes. If a user clicks Cancel, the macro finishes. Line enables error trapping for when line creates a reference to the Outlook application. Line fails if Outlook is not installed: line displays a message, and the macro finishes. In line 9, GetNamespace provides access to the Outlook data of the loggedon user. The "MAPI" argument (Mail Application Programming Interface) denotes access to mail and other Inbox items. The Namespace object has a PickFolder method, used by line to display the dialog box shown here. The chosen folder becomes the folder object, afolder. Note that there may be subfolders within each folder. Line resets a progress bar control, on a UserForm named frmprogress. This UserForm is shown on the next page. It has a label, a progress bar, and a Cancel button. AbleOwl (SEY) Ltd 00

12 Line supplies three arguments to the oasearchthroughitems macro shown below The oasearchthroughitems macro (below) has three arguments: (a) Outlook folder to search in. (b) Attachment filename to find. (c) Number of items searched. Line of the macro below updates the label control of the UserForm shown on the right Sub oasearchthroughitems(afolder, afilename, aitemsdone) Dim aitem As Object, aattachment As Object, asubfolder As Object frmprogress.lblprogress = "Searching " & afolder.name & " folder..." For Each aitem In afolder.items If TypeName(aItem) = "MailItem" Then 'If item is an message For Each aattachment In aitem.attachments If aattachment.filename = afilename Then mfilefound = True MsgBox "Found file in dated " & aitem.receivedtime & vbcr _ & " - saving to " & ThisWorkbook.Path & "\" & afilename aattachment.saveasfile ThisWorkbook.Path & "\" & afilename Next aattachment aitemsdone = aitemsdone + If aitemsdone Mod 0 = 0 Then frmprogress.prgbar.value = (aitemsdone / mtotalitemscount) * 00 DoEvents 'Every ten items, re-draw the progress bar If frmprogress.pcancelled Then Exit For 'If Cancel button clicked on UserForm Next aitem For Each asubfolder In afolder.folders oasearchthroughitems asubfolder, afilename, aitemsdone 'Run this macro (recurse) Next asubfolder The first For Each loop processes folder items; the second For Each loop processes attachments Line begins a loop through each item in afolder. Not all of the items are messages; the If test at line is only True when aitem represents an message. Then, line begins another loop through each attachment (if any) of the message. If the filename of the attachment matches the filename being searched for, mfilefound receives a value of True (line ). Line 9 displays a message box when the attachment name matches the desired filename You might like to add vbinformation The progress bar updates once for every ten items processed There is a Cancel button that sets a public variable Another For Each loop causes the macro to run itself (recurse) for each subfolder The oagettotalitemscount macro is also recursive, but is a simpler example To report when the macro finds the file, line 9 displays the message box shown on the right. Line 0 saves the attachment to the folder of the macro workbook. As a refinement, you might like to add vbinformation as a second MsgBox argument. When the number of items done is evenly divisible by 0, line updates the progress bar. The value is the percentage that aitemsdone represents of the total count. Excel does not re-draw the progress bar until line (DoEvents) briefly pauses macro execution. The Cancel button on the UserForm sets a public variable (defined in the UserForm as Public pcancelled As Boolean) to True. When that happens, line 9 exits the aitem loop. The loop at line repeats for each subfolder of afolder. Line runs this macro again to search each subfolder an elegant recursion. asubfolder becomes afolder; afilename and aitemsdone are passed through to the next iteration of the macro. Thus the progress bar continues, and line updates the label to show the name of the currently-searched folder. If the recursive logic proves to be a brain strain, take a look at the oagettotalitemscount macro in the example file (not shown here). This short macro counts the number of items in the folder supplied as an argument, adds the count to mtotalitemscount, and then runs itself for all subfolders. The macro is easy to step through place a breakpoint, and then use the F key. AbleOwl (SEY) Ltd 00

Introduction to Microsoft Excel 2007

Introduction to Microsoft Excel 2007 Introduction to Microsoft Excel 2007 Microsoft Excel is a very powerful tool for you to use for numeric computations and analysis. Excel can also function as a simple database but that is another class.

More information

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 GETTING STARTED PAGE 02 Prerequisites What You Will Learn MORE TASKS IN MICROSOFT EXCEL PAGE 03 Cutting, Copying, and Pasting Data Basic Formulas Filling Data

More information

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010 DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites What You Will Learn MORE TASKS IN MICROSOFT EXCEL PAGE 03 Cutting, Copying, and Pasting Data Filling Data Across Columns

More information

Using Microsoft Excel

Using Microsoft Excel About Excel Using Microsoft Excel What is a Spreadsheet? Microsoft Excel is a program that s used for creating spreadsheets. So what is a spreadsheet? Before personal computers were common, spreadsheet

More information

The Item_Master_addin.xlam is an Excel add-in file used to provide additional features to assist during plan development.

The Item_Master_addin.xlam is an Excel add-in file used to provide additional features to assist during plan development. Name: Tested Excel Version: Compatible Excel Version: Item_Master_addin.xlam Microsoft Excel 2013, 32bit version Microsoft Excel 2007 and up (32bit and 64 bit versions) Description The Item_Master_addin.xlam

More information

Microsoft Excel 2007

Microsoft Excel 2007 Learning computers is Show ezy Microsoft Excel 2007 301 Excel screen, toolbars, views, sheets, and uses for Excel 2005-8 Steve Slisar 2005-8 COPYRIGHT: The copyright for this publication is owned by Steve

More information

outlook-vba #outlookvba

outlook-vba #outlookvba outlook-vba #outlookvba Table of Contents About 1 Chapter 1: Getting started with outlook-vba 2 Remarks 2 Examples 2 Introduction 2 Outlook Visual Basic for Applications 3 Advanced topics 3 Chapter 2:

More information

SPREADSHEET (Excel 2007)

SPREADSHEET (Excel 2007) SPREADSHEET (Excel 2007) 1 U N I T 0 4 BY I F T I K H A R H U S S A I N B A B U R Spreadsheet Microsoft Office Excel 2007 (or Excel) is a computer program used to enter, analyze, and present quantitative

More information

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and VBA AND MACROS VBA is a major division of the stand-alone Visual Basic programming language. It is integrated into Microsoft Office applications. It is the macro language of Microsoft Office Suite. Previously

More information

Getting Started Guide

Getting Started Guide Getting Started Guide Sage MAS Intelligence 90/200 Table of Contents Getting Started Guide... 1 Login Properties... 1 Standard Reports Available... 2 Financial Report... 2 Financial Trend Analysis... 3

More information

Working with Tables in Word 2010

Working with Tables in Word 2010 Working with Tables in Word 2010 Table of Contents INSERT OR CREATE A TABLE... 2 USE TABLE TEMPLATES (QUICK TABLES)... 2 USE THE TABLE MENU... 2 USE THE INSERT TABLE COMMAND... 2 KNOW YOUR AUTOFIT OPTIONS...

More information

Advanced Excel Macros : Data Validation/Analysis : OneDrive

Advanced Excel Macros : Data Validation/Analysis : OneDrive Advanced Excel Macros : Data Validation/Analysis : OneDrive Macros Macros in Excel are in short, a recording of keystrokes. Beyond simple recording, you can use macros to automate tasks that you will use

More information

6/14/2010. VBA program units: Subroutines and Functions. Functions: Examples: Examples:

6/14/2010. VBA program units: Subroutines and Functions. Functions: Examples: Examples: VBA program units: Subroutines and Functions Subs: a chunk of VBA code that can be executed by running it from Excel, from the VBE, or by being called by another VBA subprogram can be created with the

More information

This book is about using Microsoft Excel to

This book is about using Microsoft Excel to Introducing Data Analysis with Excel This book is about using Microsoft Excel to analyze your data. Microsoft Excel is an electronic worksheet you can use to perform mathematical, financial, and statistical

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Table of Contents The Excel Window... 2 The Formula Bar... 3 Workbook View Buttons... 3 Moving in a Spreadsheet... 3 Entering Data... 3 Creating and Renaming Worksheets... 4 Opening

More information

Identifying Updated Metadata and Images from a Content Provider

Identifying Updated Metadata and Images from a Content Provider University of Iowa Libraries Staff Publications 4-8-2010 Identifying Updated Metadata and Images from a Content Provider Wendy Robertson University of Iowa 2010 Wendy C Robertson Comments Includes presenter's

More information

Microsoft Excel > Shortcut Keys > Shortcuts

Microsoft Excel > Shortcut Keys > Shortcuts Microsoft Excel > Shortcut Keys > Shortcuts Function Keys F1 Displays the Office Assistant or (Help > Microsoft Excel Help) F2 Edits the active cell, putting the cursor at the end* F3 Displays the (Insert

More information

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Basic Topics: Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex Review ribbon terminology such as tabs, groups and commands Navigate a worksheet, workbook, and multiple workbooks Prepare

More information

EXCEL BASICS: MICROSOFT OFFICE 2010

EXCEL BASICS: MICROSOFT OFFICE 2010 EXCEL BASICS: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes

More information

Adding records Pasting records Deleting records Sorting records Filtering records Inserting and deleting columns Calculated columns Working with the

Adding records Pasting records Deleting records Sorting records Filtering records Inserting and deleting columns Calculated columns Working with the Show All About spreadsheets You can use a spreadsheet to enter and calculate data. A spreadsheet consists of columns and rows of cells. You can enter data directly into the cells of the spreadsheet and

More information

Spreadsheet Applications Test

Spreadsheet Applications Test Spreadsheet Applications Test 1. The expression returns the maximum value in the range A1:A100 and then divides the value by 100. a. =MAX(A1:A100/100) b. =MAXIMUM(A1:A100)/100 c. =MAX(A1:A100)/100 d. =MAX(100)/(A1:A100)

More information

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1 Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1 1 Contents Accessing the SAI reports... 3 Copying, Pasting and Renaming Reports... 4 Creating and linking a report... 6 Auto e-mailing reports...

More information

MICROSOFT EXCEL KEYBOARD SHORCUTS

MICROSOFT EXCEL KEYBOARD SHORCUTS MICROSOFT EXCEL KEYBOARD SHORCUTS F1 Displays the Office Assistant or (Help > Microsoft Excel Help) F2 Edits the active cell, putting the cursor at the end F3 Displays the (Insert > Name > Paste) dialog

More information

Workbook Also called a spreadsheet, the Workbook is a unique file created by Excel. Title bar

Workbook Also called a spreadsheet, the Workbook is a unique file created by Excel. Title bar Microsoft Excel 2007 is a spreadsheet application in the Microsoft Office Suite. A spreadsheet is an accounting program for the computer. Spreadsheets are primarily used to work with numbers and text.

More information

Getting Started Guide. Sage MAS Intelligence 500

Getting Started Guide. Sage MAS Intelligence 500 Getting Started Guide Sage MAS Intelligence 500 Table of Contents Getting Started Guide... 1 Login Properties... 1 Standard Reports Available... 2 Financial Report... 2 Financial Trend Analysis... 3 Dashboard

More information

EXCEL BASICS: MICROSOFT OFFICE 2007

EXCEL BASICS: MICROSOFT OFFICE 2007 EXCEL BASICS: MICROSOFT OFFICE 2007 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes

More information

COPYRIGHTED MATERIAL. Making Excel More Efficient

COPYRIGHTED MATERIAL. Making Excel More Efficient Making Excel More Efficient If you find yourself spending a major part of your day working with Excel, you can make those chores go faster and so make your overall work life more productive by making Excel

More information

PART 7. Getting Started with Excel

PART 7. Getting Started with Excel PART 7 Getting ed with Excel When you start the application, Excel displays a blank workbook. A workbook is a file in which you store your data, similar to a three-ring binder. Within a workbook are worksheets,

More information

1. Managing Information in Table

1. Managing Information in Table 1. Managing Information in Table Spreadsheets are great for making lists (such as phone lists, client lists). The researchers discovered that not only was list management the number one spreadsheet activity,

More information

DOWNLOAD PDF VBA MACRO TO PRINT MULTIPLE EXCEL SHEETS TO ONE

DOWNLOAD PDF VBA MACRO TO PRINT MULTIPLE EXCEL SHEETS TO ONE Chapter 1 : Print Multiple Sheets Macro to print multiple sheets I have a spreadsheet set up with multiple worksheets. I have one worksheet (Form tab) created that will pull data from the other sheets

More information

1 Introduction to Excel Databases April 09

1 Introduction to Excel Databases April 09 1 Introduction to Excel Databases April 09 Contents INTRODUCTION TO DATABASES... 3 CREATING A DATABASE... 3 SORTING DATA... 4 DATA FORMS... 5 Data Form options... 5 Using Criteria... 6 FILTERING DATA...

More information

Use mail merge to create and print letters and other documents

Use mail merge to create and print letters and other documents Use mail merge to create and print letters and other documents Contents Use mail merge to create and print letters and other documents... 1 Set up the main document... 1 Connect the document to a data

More information

Microsoft Excel Microsoft Excel

Microsoft Excel Microsoft Excel Excel 101 Microsoft Excel is a spreadsheet program that can be used to organize data, perform calculations, and create charts and graphs. Spreadsheets or graphs created with Microsoft Excel can be imported

More information

INTRODUCTION... 1 UNDERSTANDING CELLS... 2 CELL CONTENT... 4

INTRODUCTION... 1 UNDERSTANDING CELLS... 2 CELL CONTENT... 4 Introduction to Microsoft Excel 2016 INTRODUCTION... 1 The Excel 2016 Environment... 1 Worksheet Views... 2 UNDERSTANDING CELLS... 2 Select a Cell Range... 3 CELL CONTENT... 4 Enter and Edit Data... 4

More information

Introduction to Excel 2007

Introduction to Excel 2007 Introduction to Excel 2007 These documents are based on and developed from information published in the LTS Online Help Collection (www.uwec.edu/help) developed by the University of Wisconsin Eau Claire

More information

IP4 - Running reports

IP4 - Running reports To assist with tracking and monitoring HRIS recruitment and personnel, reports can be run from Discoverer Plus. This guide covers the following process steps: Logging in... 2 What s changed? Changed reference

More information

Open. Select the database and click. Print. Set printing options using the dropdown menus, then click the

Open. Select the database and click. Print. Set printing options using the dropdown menus, then click the The Original Quick Reference Guides Microsoft Access 2010 Access is a tool for creating and managing databases collections of related records structured in an easily accessible format such as a table,

More information

SUM - This says to add together cells F28 through F35. Notice that it will show your result is

SUM - This says to add together cells F28 through F35. Notice that it will show your result is COUNTA - The COUNTA function will examine a set of cells and tell you how many cells are not empty. In this example, Excel analyzed 19 cells and found that only 18 were not empty. COUNTBLANK - The COUNTBLANK

More information

DISCOVERER Discoverer January 2015

DISCOVERER Discoverer January 2015 DISCOVERER Discoverer January 2015 Table of Contents Introduction 1 What are workbooks 2 What are worksheets 2 What is my username for Discoverer 3 Opening Discoverer 4 Connecting to Discoverer 4 A Required

More information

Microsoft Excel 2007 Macros and VBA

Microsoft Excel 2007 Macros and VBA Microsoft Excel 2007 Macros and VBA With the introduction of Excel 2007 Microsoft made a number of changes to the way macros and VBA are approached. This document outlines these special features of Excel

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Formatting a spreadsheet means changing the way it looks to make it neater and more attractive. Formatting changes can include modifying number styles, text size and colours. Many

More information

Getting started 7. Writing macros 23

Getting started 7. Writing macros 23 Contents 1 2 3 Getting started 7 Introducing Excel VBA 8 Recording a macro 10 Viewing macro code 12 Testing a macro 14 Editing macro code 15 Referencing relatives 16 Saving macros 18 Trusting macros 20

More information

Excel Shortcuts Increasing YOUR Productivity

Excel Shortcuts Increasing YOUR Productivity Excel Shortcuts Increasing YOUR Productivity CompuHELP Division of Tommy Harrington Enterprises, Inc. tommy@tommyharrington.com https://www.facebook.com/tommyharringtonextremeexcel Excel Shortcuts Increasing

More information

Microsoft How to Series

Microsoft How to Series Microsoft How to Series Getting Started with EXCEL 2007 A B C D E F Tabs Introduction to the Excel 2007 Interface The Excel 2007 Interface is comprised of several elements, with four main parts: Office

More information

Creating a Spreadsheet by Using Excel

Creating a Spreadsheet by Using Excel The Excel window...40 Viewing worksheets...41 Entering data...41 Change the cell data format...42 Select cells...42 Move or copy cells...43 Delete or clear cells...43 Enter a series...44 Find or replace

More information

Microsoft Excel Chapter 1. Creating a Worksheet and an Embedded Chart

Microsoft Excel Chapter 1. Creating a Worksheet and an Embedded Chart Microsoft Excel 2010 Chapter 1 Creating a Worksheet and an Embedded Chart Objectives Describe the Excel worksheet Enter text and numbers Use the Sum button to sum a range of cells Copy the contents of

More information

VBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide

VBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide VBA Visual Basic for Applications Learner Guide 1 Table of Contents SECTION 1 WORKING WITH MACROS...5 WORKING WITH MACROS...6 About Excel macros...6 Opening Excel (using Windows 7 or 10)...6 Recognizing

More information

Microsoft Excel 2010 Level 1

Microsoft Excel 2010 Level 1 Microsoft Excel 2010 Level 1 One Day Course Course Description You have basic computer skills such as using a mouse, navigating through windows, and surfing the Internet. You have also used paper-based

More information

variables programming statements

variables programming statements 1 VB PROGRAMMERS GUIDE LESSON 1 File: VbGuideL1.doc Date Started: May 24, 2002 Last Update: Dec 27, 2002 ISBN: 0-9730824-9-6 Version: 0.0 INTRODUCTION TO VB PROGRAMMING VB stands for Visual Basic. Visual

More information

version staff had them to share viewing this this user guide. >Reports, as Logging In the SQL login User Name for your district. perform the guides.

version staff had them to share viewing this this user guide. >Reports, as Logging In the SQL login User Name for your district. perform the guides. This report is available for use by all administrative and teaching staff. Data presented in the report is organized by teacher s rosters. The report has been shown to several districts and the teaching

More information

EXCEL 2003 DISCLAIMER:

EXCEL 2003 DISCLAIMER: EXCEL 2003 DISCLAIMER: This reference guide is meant for experienced Microsoft Excel users. It provides a list of quick tips and shortcuts for familiar features. This guide does NOT replace training or

More information

Excel Advanced

Excel Advanced Excel 2016 - Advanced LINDA MUCHOW Alexandria Technical & Community College 320-762-4539 lindac@alextech.edu Table of Contents Macros... 2 Adding the Developer Tab in Excel 2016... 2 Excel Macro Recorder...

More information

Microsoft Excel 2016 Level 1

Microsoft Excel 2016 Level 1 Microsoft Excel 2016 Level 1 One Day Course Course Description You have basic computer skills such as using a mouse, navigating through windows, and surfing the Internet. You have also used paper-based

More information

Excel Select a template category in the Office.com Templates section. 5. Click the Download button.

Excel Select a template category in the Office.com Templates section. 5. Click the Download button. Microsoft QUICK Excel 2010 Source Getting Started The Excel Window u v w z Creating a New Blank Workbook 2. Select New in the left pane. 3. Select the Blank workbook template in the Available Templates

More information

EDIT202 Spreadsheet Lab Prep Sheet

EDIT202 Spreadsheet Lab Prep Sheet EDIT202 Spreadsheet Lab Prep Sheet While it is clear to see how a spreadsheet may be used in a classroom to aid a teacher in marking (as your lab will clearly indicate), it should be noted that spreadsheets

More information

Database Concepts Using Microsoft Access

Database Concepts Using Microsoft Access lab Database Concepts Using Microsoft Access 9 Objectives: Upon successful completion of Lab 9, you will be able to Understand fundamental concepts including database, table, record, field, field name,

More information

6. Essential Spreadsheet Operations

6. Essential Spreadsheet Operations 6. Essential Spreadsheet Operations 6.1 Working with Worksheets When you open a new workbook in Excel, the workbook has a designated number of worksheets in it. You can specify how many sheets each new

More information

TIPS & TRICKS SERIES

TIPS & TRICKS SERIES TIPS & TRICKS SERIES TIPS & TRICKS OFFICE XP MACROS C o m p i l e d b y MUHAMMAD AJMAL BEIG NAZ TIPS & TRICKS OFFICE XP MACROS P a g e 1 CONTENTS Table of Contents OFFICE XP MACROS 3 ABOUT MACROS 3 MICROSOFT

More information

Excel 2013 Beyond TheBasics

Excel 2013 Beyond TheBasics Excel 2013 Beyond TheBasics INSTRUCTOR: IGNACIO DURAN Excel 2013 Beyond The Basics This is a class for beginning computer users. You are only expected to know how to use the mouse and keyboard, open a

More information

1 Welcome to Microsoft Excel 2007

1 Welcome to Microsoft Excel 2007 1 Welcome to Microsoft Excel 2007 The Excel Window With Office 2007, Microsoft has abandoned the interface consisting of a menu and a collection of toolbars so common in all Windows applications until

More information

A PRACTICAL TUTORIAL TO EXCEL

A PRACTICAL TUTORIAL TO EXCEL 2010 BEGINNERS A PRACTICAL TUTORIAL TO EXCEL by: Julio C. Fajardo A Practical Tutorial to Excel About: Excel is one of the early software tools developed by Microsoft. The program has been widely adopted

More information

Table of Contents. Word. Using the mouse wheel 39 Moving the insertion point using the keyboard 40 Resume reading 41

Table of Contents. Word. Using the mouse wheel 39 Moving the insertion point using the keyboard 40 Resume reading 41 Table of Contents iii Table of Contents Word Starting Word What is word processing? 2 Starting Word 2 Exploring the Start screen 4 Creating a blank document 4 Exploring the Word document window 5 Exploring

More information

Word 2016 Advanced. North American Edition SAMPLE

Word 2016 Advanced. North American Edition SAMPLE Word 2016 Advanced Word 2016 Advanced North American Edition WORD 2016 ADVANCED Page 2 2015 Cheltenham Group Pty. Ltd. All trademarks acknowledged. E&OE. No part of this document may be copied without

More information

Excel Level 3 - Advanced

Excel Level 3 - Advanced Excel Level 3 - Advanced Introduction This document covers some of the more advanced features of Excel. Spreadsheets can be used in such a multiplicity of ways that it cannot hope to even touch on all

More information

Expedient User Manual Getting Started

Expedient User Manual Getting Started Volume 1 Expedient User Manual Getting Started Gavin Millman & Associates Pty Ltd 281 Buckley Street Essendon VIC 3040 Phone 03 9331 3944 Web www.expedientsoftware.com.au Table of Contents Logging In...

More information

Patricia Andrada Quick Guide Excel 2010 Data Management-July 2011 Page 1

Patricia Andrada Quick Guide Excel 2010 Data Management-July 2011 Page 1 Patricia Andrada Quick Guide Excel 2010 Data Management-July 2011 Page 1 Excel 2010 Data Management AutoFill and Custom Lists AutoFill 1. Select the range that contains the initial value(s) of the series

More information

MAS 90/200 Intelligence Tips and Tricks Booklet Vol. 1

MAS 90/200 Intelligence Tips and Tricks Booklet Vol. 1 MAS 90/200 Intelligence Tips and Tricks Booklet Vol. 1 1 Contents Accessing the Sage MAS Intelligence Reports... 3 Copying, Pasting and Renaming Reports... 4 To create a new report from an existing report...

More information

Step 1: Prepare the worksheet data in Excel for the mail merge You can FT Menu Prompt # 1 R for Report.

Step 1: Prepare the worksheet data in Excel for the mail merge You can FT Menu Prompt # 1 R for Report. Creating Address Labels from Microsoft Word Mail Merge If you want to send a mass mailing to an address list that you maintain in a Microsoft Office Excel worksheet, you can use a Microsoft Office Word

More information

User Guide. Version 2.0. Excel Spreadsheet to AutoCAD drawing Utility. Supports AutoCAD 2000 through Supports Excel 97, 2000, XP, 2003, 2007

User Guide. Version 2.0. Excel Spreadsheet to AutoCAD drawing Utility. Supports AutoCAD 2000 through Supports Excel 97, 2000, XP, 2003, 2007 User Guide Spread2Cad Pro! Version 2.0 Excel Spreadsheet to AutoCAD drawing Utility Supports AutoCAD 2000 through 2007 Supports Excel 97, 2000, XP, 2003, 2007 Professional tools for productivity! 1 Bryon

More information

12 BASICS OF MS-EXCEL

12 BASICS OF MS-EXCEL 12 BASICS OF MS-EXCEL 12.1 INTRODUCTION MS-Excel 2000 is a Windows based application package. It is quite useful in entering, editing, analysis and storing of data. Arithmetic operations with numerical

More information

Chapter 4. Microsoft Excel

Chapter 4. Microsoft Excel Chapter 4 Microsoft Excel Topic Introduction Spreadsheet Basic Screen Layout Modifying a Worksheet Formatting Cells Formulas and Functions Sorting and Filling Borders and Shading Charts Introduction A

More information

KEYWORDS DDE GETOBJECT PATHNAME CLASS VB EDITOR WITHEVENTS HMI 1.0 TYPE LIBRARY HMI.TAG

KEYWORDS DDE GETOBJECT PATHNAME CLASS VB EDITOR WITHEVENTS HMI 1.0 TYPE LIBRARY HMI.TAG Document Number: IX_APP00113 File Name: SpreadsheetLinking.doc Date: January 22, 2003 Product: InteractX Designer Application Note Associated Project: GetObjectDemo KEYWORDS DDE GETOBJECT PATHNAME CLASS

More information

Sage 50 U.S. Edition Intelligence Reporting Getting Started Guide

Sage 50 U.S. Edition Intelligence Reporting Getting Started Guide Sage Intelligence Reporting Sage 50 U.S. Edition Intelligence Reporting Getting Started Guide Table of Contents Introduction... 2 System requirements... 3 How it works... 4 Getting started guide... 5 Running

More information

Ms excel. The Microsoft Office Button. The Quick Access Toolbar

Ms excel. The Microsoft Office Button. The Quick Access Toolbar Ms excel MS Excel is electronic spreadsheet software. In This software we can do any type of Calculation & inserting any table, data and making chart and graphs etc. the File of excel is called workbook.

More information

EXCEL CONNECT USER GUIDE

EXCEL CONNECT USER GUIDE USER GUIDE Developed and published by Expedience Software Copyright 2012-2017 Expedience Software Excel Connect Contents About this Guide... 1 The Style Palette User Guide 1 Excel Connect Overview... 2

More information

Microsoft Excel Level 2

Microsoft Excel Level 2 Microsoft Excel Level 2 Table of Contents Chapter 1 Working with Excel Templates... 5 What is a Template?... 5 I. Opening a Template... 5 II. Using a Template... 5 III. Creating a Template... 6 Chapter

More information

Table of Contents COURSE OVERVIEW... 5

Table of Contents COURSE OVERVIEW... 5 Table of Contents COURSE OVERVIEW... 5 DISCUSSION... 5 THE NEW DATABASE FORMAT... 5 COURSE TOPICS... 6 CONVENTIONS USED IN THIS MANUAL... 7 Tip Open a File... 7 LESSON 1: THE NEW INTERFACE... 8 LESSON

More information

Creating Automated Dashboard Excel 2013 Contents

Creating Automated Dashboard Excel 2013 Contents Creating Automated Dashboard Excel 2013 Contents Summarize Data Using Pivot Table... 2 Constructing Report Summary... 2 Create a PivotTable from worksheet data... 2 Add fields to a PivotTable... 2 Grouping

More information

Excel 2016 Basics for Mac

Excel 2016 Basics for Mac Excel 2016 Basics for Mac Excel 2016 Basics for Mac Training Objective To learn the tools and features to get started using Excel 2016 more efficiently and effectively. What you can expect to learn from

More information

PHLI Instruction (734) Introduction. Lists.

PHLI Instruction (734) Introduction. Lists. INTERMEDIATE EXCEL Introduction Microsoft Excel has many purposes. In addition to being an excellent data manger, Excel provides the means to perform complex analysis and evaluation of data. This brief

More information

Full file at Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries

Full file at   Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries MULTIPLE CHOICE 1. To start a new line in a cell, press after each line, except for the last line, which is completed by clicking the

More information

Lecture- 5. Introduction to Microsoft Excel

Lecture- 5. Introduction to Microsoft Excel Lecture- 5 Introduction to Microsoft Excel The Microsoft Excel Window Microsoft Excel is an electronic spreadsheet. You can use it to organize your data into rows and columns. You can also use it to perform

More information

THE EXCEL ENVIRONMENT... 1 EDITING...

THE EXCEL ENVIRONMENT... 1 EDITING... Excel Essentials TABLE OF CONTENTS THE EXCEL ENVIRONMENT... 1 EDITING... 1 INSERTING A COLUMN... 1 DELETING A COLUMN... 1 INSERTING A ROW... DELETING A ROW... MOUSE POINTER SHAPES... USING AUTO-FILL...

More information

Working with Tables in Microsoft Word

Working with Tables in Microsoft Word Working with Tables in Microsoft Word Microsoft Word offers a number of ways to make a table. The best way depends on how you like to work, and on how simple or complex the table needs to be. 1. Click

More information

Intermediate Excel 2003

Intermediate Excel 2003 Intermediate Excel 2003 Introduction The aim of this document is to introduce some techniques for manipulating data within Excel, including sorting, filtering and how to customise the charts you create.

More information

MgtOp 470 Business Modeling with Spreadsheets Sample Midterm Exam. 1. Spreadsheets are known as the of business analysis.

MgtOp 470 Business Modeling with Spreadsheets Sample Midterm Exam. 1. Spreadsheets are known as the of business analysis. Section 1 Multiple Choice MgtOp 470 Business Modeling with Spreadsheets Sample Midterm Exam 1. Spreadsheets are known as the of business analysis. A. German motor car B. Mexican jumping bean C. Swiss army

More information

Excel 2013 Part 2. 2) Creating Different Charts

Excel 2013 Part 2. 2) Creating Different Charts Excel 2013 Part 2 1) Create a Chart (review) Open Budget.xlsx from Documents folder. Then highlight the range from C5 to L8. Click on the Insert Tab on the Ribbon. From the Charts click on the dialogue

More information

MICROSOFT Excel 2010 Advanced Self-Study

MICROSOFT Excel 2010 Advanced Self-Study MICROSOFT Excel 2010 Advanced Self-Study COPYRIGHT This manual is copyrighted: S&G Training Limited. This manual may not be copied, photocopied or reproduced in whole or in part without the written permission

More information

MultiSite Suite: General Ledger

MultiSite Suite: General Ledger MultiSite Suite: General Ledger User s Manual version 2.2.97 Copyright & Trademarks Copyright Notice and Trademarks 2003 by Brent Lawrence, LLC. All rights reserved. Reprinted and edited by MultiSite Systems,

More information

Sage Intelligence: Copying, Pasting and Renaming Reports 3. Sage Intelligence: Creating and Linking a Report 5

Sage Intelligence: Copying, Pasting and Renaming Reports 3. Sage Intelligence: Creating and Linking a Report 5 Table of Contents Sage Intelligence: Copying, Pasting and Renaming Reports 3 Sage Intelligence: Creating and Linking a Report 5 Bulk Import of Sage Intelligence Reports 7 Converting an Excel 2003 template

More information

Create your first workbook

Create your first workbook Create your first workbook You've been asked to enter data in Excel, but you've never worked with Excel. Where do you begin? Or perhaps you have worked in Excel a time or two, but you still wonder how

More information

Skills Exam Objective Objective Number

Skills Exam Objective Objective Number Overview 1 LESSON SKILL MATRIX Skills Exam Objective Objective Number Starting Excel Create a workbook. 1.1.1 Working in the Excel Window Customize the Quick Access Toolbar. 1.4.3 Changing Workbook and

More information

Microsoft Office Excel 2007: Basic. Course Overview. Course Length: 1 Day. Course Overview

Microsoft Office Excel 2007: Basic. Course Overview. Course Length: 1 Day. Course Overview Microsoft Office Excel 2007: Basic Course Length: 1 Day Course Overview This course teaches the basic functions and features of Excel 2007. After an introduction to spreadsheet terminology and Excel's

More information

3/31/2016. Spreadsheets. Spreadsheets. Spreadsheets and Data Management. Unit 3. Can be used to automatically

3/31/2016. Spreadsheets. Spreadsheets. Spreadsheets and Data Management. Unit 3. Can be used to automatically MICROSOFT EXCEL and Data Management Unit 3 Thursday March 31, 2016 Allow users to perform simple and complex sorting Allow users to perform calculations quickly Organizes and presents figures that can

More information

Microsoft Excel Office 2016/2013/2010/2007 Tips and Tricks

Microsoft Excel Office 2016/2013/2010/2007 Tips and Tricks Microsoft Excel Office 2016/2013/2010/2007 Tips and Tricks In Office 2007, the OFFICE BUTTON is the symbol at the top left of the screen. 1 Enter Fractions That Will Display And Calculate Properly a. Type

More information

Excel Main Screen. Fundamental Concepts. General Keyboard Shortcuts Open a workbook Create New Save Preview and Print Close a Workbook

Excel Main Screen. Fundamental Concepts. General Keyboard Shortcuts Open a workbook Create New Save Preview and Print Close a Workbook Excel 2016 Main Screen Fundamental Concepts General Keyboard Shortcuts Open a workbook Create New Save Preview and Print Close a Ctrl + O Ctrl + N Ctrl + S Ctrl + P Ctrl + W Help Run Spell Check Calculate

More information

Day : Date : Objects : Open MS Excel program * Open Excel application. Select : start. Choose: programs. Choose : Microsoft Office.

Day : Date : Objects : Open MS Excel program * Open Excel application. Select : start. Choose: programs. Choose : Microsoft Office. Day : Date : Objects : Open MS Excel program * Open Excel application. Select : start Choose: programs Choose : Microsoft Office Select: Excel *The interface of Excel program - Menu bar. - Standard bar.

More information

This chapter is intended to take you through the basic steps of using the Visual Basic

This chapter is intended to take you through the basic steps of using the Visual Basic CHAPTER 1 The Basics This chapter is intended to take you through the basic steps of using the Visual Basic Editor window and writing a simple piece of VBA code. It will show you how to use the Visual

More information

Microsoft Excel 2010 Basic

Microsoft Excel 2010 Basic Microsoft Excel 2010 Basic Introduction to MS Excel 2010 Microsoft Excel 2010 is a spreadsheet software in the new Microsoft 2010 Office Suite. Excel allows you to store, manipulate and analyze data in

More information

Introduction to Microsoft Excel 2010

Introduction to Microsoft Excel 2010 Introduction to Microsoft Excel 2010 This class is designed to cover the following basics: What you can do with Excel Excel Ribbon Moving and selecting cells Formatting cells Adding Worksheets, Rows and

More information