ov 4 - 1 copyright © 2011 element k content llc. all rights reserved. insert, copy, and delete...

11
OV 4 - 1 ght © 2011 Element K Content LLC. All rights reserved. Insert, Copy, and Delete Worksheets Rename Worksheets Modify the Order of Worksheets Print Worksheets Working with Multiple Worksheet

Upload: eustace-parrish

Post on 28-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 1Copyright © 2011 Element K Content LLC. All rights reserved.

Insert, Copy, and Delete Worksheets Rename Worksheets Modify the Order of Worksheets Print Worksheets

Working with Multiple Worksheet

Page 2: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 2Copyright © 2011 Element K Content LLC. All rights reserved.

The Add Method

Worksheets.Add

Worksheets.Add Before:=Worksheets(3)

Worksheets.Add After:=Worksheets(1)

Worksheet object reference

Worksheet object reference

Adds a new worksheetat the end of the worksheet list

Adds a new worksheetat the end of the worksheet list

Adds a new worksheet after the first worksheet

Adds a new worksheet after the first worksheet

Adds a new worksheet before the third worksheet

Adds a new worksheet before the third worksheet

Page 3: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 3Copyright © 2011 Element K Content LLC. All rights reserved.

The Copy Method

Worksheets(2).Copy Before:=Worksheets(4)

Worksheets(2).Copy After:=Worksheets(2)

Worksheet referenced for duplication

Worksheet referenced for duplication

Worksheet object

referenced

Worksheet object

referenced

Optional variants used to positionthe duplicate worksheet

Optional variants used to positionthe duplicate worksheet

Page 4: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 4Copyright © 2011 Element K Content LLC. All rights reserved.

The Delete Method

Worksheets(2).Delete

Worksheet object referenced

Worksheet object referenced

Worksheet referencedfor deletion

Worksheet referencedfor deletion

Page 5: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 5Copyright © 2011 Element K Content LLC. All rights reserved.

Expressions

Result assigned to a variable as a single data value

Result assigned to a variable as a single data value

Combination of data, operators, functions, and variables

Combination of data, operators, functions, and variables

Sales Percentage = (Sales) / Sum(Sales) * 100

Page 6: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 6Copyright © 2011 Element K Content LLC. All rights reserved.

The DateSerial Function

DateSerial(2011, 11, 28)

November 28, 2011

Integer values representing year, month, and day

Integer values representing year, month, and day

Date value returned by the functionDate value returned by the function

Page 7: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 7Copyright © 2011 Element K Content LLC. All rights reserved.

The Format Function

Expression returns Date dataIn the format May 27, 2011

Expression returns Date dataIn the format May 27, 2011

Format(27/05/2011,“Long Date")

Page 8: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 8Copyright © 2011 Element K Content LLC. All rights reserved.

The Move Method

Worksheets(2).Move Before:=Worksheets(4)

Worksheets(2).Move After:=Worksheets(2)

Worksheet referencedfor moving

Worksheet referencedfor moving

Worksheet object

referenced

Worksheet object

referenced

Optional variants used to position the worksheet

Optional variants used to position the worksheet

Page 9: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 9Copyright © 2011 Element K Content LLC. All rights reserved.

The PrintPreview Method

Worksheets.PrintPreview

Worksheets(2).PrintPreview

Worksheets(“SE Sales”).PrintPreview

Worksheet object reference

Worksheet object reference

Previews all the worksheets in the workbook

Previews all the worksheets in the workbook

Previews the second worksheet in the workbook

Previews the second worksheet in the workbook

Previews the worksheet named SE Sales

Previews the worksheet named SE Sales

Page 10: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 10Copyright © 2011 Element K Content LLC. All rights reserved.

The PrintOut Method

Worksheets.PrintOut

Worksheets(2).PrintOut

Worksheets(“SE Sales”).PrintOut

Worksheet object reference

Worksheet object reference

Prints the worksheet named SE Sales

Prints the worksheet named SE Sales

Prints the second worksheet in the workbook

Prints the second worksheet in the workbook

Prints all the worksheets in the workbook

Prints all the worksheets in the workbook

Page 11: OV 4 - 1 Copyright © 2011 Element K Content LLC. All rights reserved.  Insert, Copy, and Delete Worksheets  Rename Worksheets  Modify the Order of Worksheets

OV 4 - 11Copyright © 2011 Element K Content LLC. All rights reserved.

1. Which tasks will you opt to perform using macros when working with multiple worksheets?

2. Which VBA method to manipulate worksheets do you think is most suitable for use to quicken your workflow? Why?

Reflective Questions