+ Reply to Thread
Results 1 to 5 of 5

Macro to save specific column on specific sheet as xlsx

  1. #1
    Forum Contributor
    Join Date
    07-24-2024
    Location
    Canada
    MS-Off Ver
    365
    Posts
    115

    Macro to save specific column on specific sheet as xlsx

    Hello,

    Attaching workbook : test.xlsb

    I am trying to save Column B of sheet "Excel Tracking" as a xlsx, while also keeping the "Table". In other words, I don't want to paste values only, I want to paste column B, including the header and table so a new workbook.

    The file name should be A2 of the "Main" sheet. In this example, it will save as 55667799.xlsx

    I currently a vba that saves the file as .txt, but I am trying to save as xlsx. It is not as simple as simple changing the extension. Although it saves as .xlsx, I can't open the file, because it is corrupted.

    Current vba code :

    Please Login or Register  to view this content.
    I really like this, because it is easy for me to save the file to a specific path.

    I am wondering how I can modify this code to save it as .xlsx instead of .txt

  2. #2
    Valued Forum Contributor
    Join Date
    09-18-2023
    Location
    Geogia, USA
    MS-Off Ver
    365
    Posts
    308

    Re: Macro to save specific column on specific sheet as xlsx

    You could do something like this:

    Please Login or Register  to view this content.
    EDIT: if you click no to deleting the exiting file the code exits
    Last edited by jdelano; 02-13-2025 at 02:06 AM.

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Macro to save specific column on specific sheet as xlsx

    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,259

    Re: Macro to save specific column on specific sheet as xlsx

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Contributor
    Join Date
    07-24-2024
    Location
    Canada
    MS-Off Ver
    365
    Posts
    115

    Re: Macro to save specific column on specific sheet as xlsx

    Quote Originally Posted by jdelano View Post
    You could do something like this:

    Please Login or Register  to view this content.
    EDIT: if you click no to deleting the exiting file the code exits
    Thank you !! That works great.

+ 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] Copy and save specific sheet as a separate worksheet xlsx
    By trpltwo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-17-2023, 02:58 AM
  2. Replies: 5
    Last Post: 07-19-2020, 03:49 PM
  3. [SOLVED] Save a copy from attacment to a specific folder when attach a xlsx in mail
    By dodde in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-07-2020, 07:25 AM
  4. Prompt user to save specific wkst in wkbk as new .xlsx file
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2020, 05:55 AM
  5. Can't save XLSX file to specific folder on Mac (Excel 2011)
    By mcomp72 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2019, 10:34 PM
  6. [SOLVED] Copy rows with specific text in specific column into specific sheet
    By Valemaar in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-22-2014, 03:23 PM
  7. Replies: 1
    Last Post: 12-10-2013, 12:11 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