Results 1 to 4 of 4

How to apply code to all sheets in an array

Threaded View

seethepuck How to apply code to all... 05-16-2013, 02:10 PM
JOHN H. DAVIS Re: How to apply code to all... 05-16-2013, 02:32 PM
seethepuck Re: How to apply code to all... 05-16-2013, 02:46 PM
JOHN H. DAVIS Re: How to apply code to all... 05-16-2013, 03:13 PM
  1. #1
    Registered User
    Join Date
    04-05-2013
    Location
    Scottsdale, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    15

    How to apply code to all sheets in an array

    I understand when working in Excel, I can select multiple sheets as a group and then apply changes to the first sheet and those same changes will be reflected in all sheets of the group. I would like some help in doing this same thing using VBA. I have attached a workbook that I hope you can use to help me understand the way to work with sheets in an array. If I enter the following code
    Sheets(Array("January", "February", "March", "Q1")).select
    I am able to select all the sheets. I want to insert rows at the same location across all the sheets. But if I use

    Rows("6:6").Insert Shift:=xlDown
    The row is inserted on the January Sheet only. Please let me know how I need to change that code in order to apply that same insert of the row on all sheets that have been selected in the array.

    Extra Credit
    The info I am working with looks like a table but is not formatted as a table. I won't be able to go back and format it as a table and I need to make sure that the formulas and conditional formatting applied to each row are copied into the newly inserted row as well.

    Thanks for any insight you can provide
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1