Exel for civil engineer

Page 35

3. Move the pointer to cell A1 and drag the mouse to the cell E10 to assign the range data that will be removed. 4. Press Delete to delete the contents of range A1 to E10 and then place the pointer in cell A1. 5. End the process by clicking Stop Recording.

The recorded macro is stored in the workbook, and to see the code you have to open the Visual Basic Editor window through Developer tab > Visual Basic. The code is created as the following:. Sub ClearOutput () ' 'Macro ClearOutput ' Range("A1:E10").Select Selection.ClearContents End Sub

In the recorded macro above there are VBA statements such as Range (), Select, Selection and ClearContents. You may a bit familiar with these statements that have been briefly explained in the previous section. The recording macro tool is very useful for writing complex code or you may indeed never imagined before, like how to manipulate a chart object such as to copy, to create a title, to change the colors, making marker, automation for creating lines, and so on. This can all be done without the need to understand more about the Excel’s object hierarchy that such “long” and may be a bit confused. An Introduction to Excel for Civil Engineers

28


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.