+ Reply to Thread
Results 1 to 6 of 6

VB to: Open workbook, adjust column widths of select sheets, save, close

  1. #1
    Forum Contributor
    Join Date
    08-23-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 365
    Posts
    166

    VB to: Open workbook, adjust column widths of select sheets, save, close

    Hi all, I am looking for a piece of vb that I can't seem to find to start me off. I am looking for a looped code to go through a bunch of workbooks in a folder and: open, adjust column widths in certain sheets, save and close. I have seen a code for this around but can't at the moment.

    Please help!!

    Thanks,

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB to: Open workbook, adjust column widths of select sheets, save, close

    Here's a rough outline:

    Please Login or Register  to view this content.
    *If you want to be more specific we can modify the code
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    08-23-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 365
    Posts
    166

    Re: VB to: Open workbook, adjust column widths of select sheets, save, close

    Thx dept, yeah a couple more things with the code I am having some trouble: having multiple sheets and multiple columns I want to adjust.
    Please Login or Register  to view this content.
    jp

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB to: Open workbook, adjust column widths of select sheets, save, close

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-23-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 365
    Posts
    166

    Re: VB to: Open workbook, adjust column widths of select sheets, save, close

    Thx again dept. I am finding the code works, but only adjusts the sheet that the workbook opens on, it doesn't direct to the correct sheet or "Key", "Key1" in my case. I am trying to figure that out for those specific sheets only.

    Please Login or Register  to view this content.
    Thanks again

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB to: Open workbook, adjust column widths of select sheets, save, close

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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] Open Workbooks and Adjust Column Width, Save, and Close VBA
    By JPSIMMON in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-01-2016, 02:35 PM
  2. VBA to adjust Column Widths
    By JPSIMMON in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2015, 06:02 PM
  3. Open/Save/Close Workbook via command button
    By nathan0519 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2015, 11:24 PM
  4. [SOLVED] Macro to open/close/save workbook
    By JonathanB2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-14-2014, 10:51 AM
  5. How to open,save and close another workbook from the current workbook using macro?
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2012, 10:42 AM
  6. Replies: 6
    Last Post: 06-04-2010, 11:55 AM
  7. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM

Tags for this Thread

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