+ Reply to Thread
Results 1 to 4 of 4

Loop through all worksheets and format data found as table

  1. #1
    Registered User
    Join Date
    10-28-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    2

    Loop through all worksheets and format data found as table

    Hi,

    I'm sure this problem is super easy for you guys. I haven't been able to get it to exactly work (I'm trying to learn VBA). I searched but didn't find what I was looking for which isn't usually the case. So my problem is I have a workbook with a number of named sheets with data dumped into them from another macro that matches files to the sheet names.

    I want to now run through all sheets except the first one (lets say it's named "Master") and format the data in each one into a table style. I can't have it format all data found because there is header information in each sheet and I have the data start at A4 across all sheets (this is a template workbook so the length of data on each sheet can change each time this process is run but it will always start at A4).

    Here is the code I have that isn't exactly working right:

    Please Login or Register  to view this content.
    Thanks for any and all help!
    Last edited by jvr2; 11-02-2014 at 09:32 PM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Loop through all worksheets and format data found as table

    Try this:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    10-28-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    2

    Re: Loop through all worksheets and format data found as table

    Thank you so much, it worked. I hope to one day be a VBA master like you.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    re: Loop through all worksheets and format data found as table

    When looping (or using sheets other than the active sheet) you just need to remember to either use With... End With or put the sheet destination (e.g. ws.Range(...) ) before the range, table, object, etc.

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Loop through worksheets and format chart 1: run time error
    By surePac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2014, 01:53 PM
  2. Creating a summary page of data found on several worksheets
    By Therese in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-27-2013, 01:31 PM
  3. Loop through worksheets and identify name of table on each
    By holmes123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2012, 01:16 PM
  4. VLookup Loop until data found?
    By SakeMan in forum Excel General
    Replies: 2
    Last Post: 09-02-2011, 10:06 AM
  5. loop through data twice & remove row if duplicate values are found
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2010, 02:29 PM

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