Excel VBA Macro: Save File As Based on Cell Value (Step-by-Step Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024

ความคิดเห็น • 23

  • @greggowaffles
    @greggowaffles  4 ปีที่แล้ว +1

    Save Worksheet As PDF (Based on Cell Value): th-cam.com/video/ssv5Y32gBAU/w-d-xo.html

  • @Troy-Echo
    @Troy-Echo 2 ปีที่แล้ว

    Just what I was looking for to finish out 3 days of finding macros and tweaking them and stacking them together to make them work. Then this video closed out the last of my work with only 4 lines of simple code that works flawlessly. I removed the naming and put in something in for the name like C2 & E2 for the name, but had to figure out how to add a space which left me feeling like an idiot when all I had to do was add in C2 & " " & E2 with a space between the quotation marks. Now I can easily break out my task to almost 80 named sheets, reply to the last email, attach the named file, delete that file and go to the next, rinse, wash and repeat until all files are sent and deleted. I wish I could express how much time this saved me as I need to do this with all these spreadsheets every week. This ends flawlessly and closes as it should, and the other two macros for some reason work fine, but fail at the last step as if it is trying to continue a loop and it has nowhere to go for the next loop. Anyway, I have another 130 spreadsheets I can do this for and share with the team.

    • @greggowaffles
      @greggowaffles  2 ปีที่แล้ว

      Glad this video was able to help you out a little! You sound like a great problem solver!!

  • @zimmecl
    @zimmecl ปีที่แล้ว

    This is good, thanks! What would be great would be a macro that would filter and save a file once for each unique value in a given column.
    To apply this idea to the example data set in this video, what if you ran the macro and it generated a file for each unique region listed in Column B? (And even better if it ONLY saved the values for each region in their corresponding file - not just the same file filtered multiple ways.)

  • @mujtaba135
    @mujtaba135 3 ปีที่แล้ว +1

    Exactly what I am looking for

  • @MrKaanbjerg
    @MrKaanbjerg 3 ปีที่แล้ว

    Hi
    Thanks for the video.
    Instead of writing the sheet name (Whatever) how do you choose the sheet based on a cell value if the cell value equals the sheet names?

  • @martinemaurizio978
    @martinemaurizio978 3 ปีที่แล้ว

    Thank you, Great video.
    I was just wondering if you could help me. I have 5 sheets and only want to save sheet 1 as new workbook.xlsx file. I do not want the filtering of the data, just save the workbook using the filename path and the cell (2,6). I am still very new at VBA.

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว

      thanks! you can use
      ThisWorkbook.Sheets("sheet 1").Copy
      and that will create a new workbook with only that sheet. you can save from there

  • @mahmooddadhiwala3971
    @mahmooddadhiwala3971 3 ปีที่แล้ว

    thank you awesome.
    would you be able to help with this - i have 10 tabs with names and data already in them. how can i save each tab into its own sheet and give it a particular name, which is a cell reference within each tab?

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว +1

      No problem! You can combine code from this video and this one to get what you want: th-cam.com/video/cFkP4Can4BY/w-d-xo.html hope that helps!

  • @alexandergdansk
    @alexandergdansk 3 ปีที่แล้ว

    Great tutorial!
    Thanx a lot!!! :)

    • @greggowaffles
      @greggowaffles  3 ปีที่แล้ว +1

      Glad to hear that! Thanks for watching!!

  • @chsproteus5770
    @chsproteus5770 4 ปีที่แล้ว

    Hi, Wondering if you could do a video that you can click the button and it will run a code where it will print active sheets to pdf, save as based on value in file path and close.
    this would be great.

    • @greggowaffles
      @greggowaffles  4 ปีที่แล้ว +1

      Thats a great idea! I'll start working on that ASAP! Thanks!!

    • @greggowaffles
      @greggowaffles  4 ปีที่แล้ว +1

      here you go! th-cam.com/video/ssv5Y32gBAU/w-d-xo.html

  • @devanshgroup2803
    @devanshgroup2803 3 ปีที่แล้ว

    Hello Sir,
    Can you share the VBA code to create .ics files from the data in Excel with different time zones & start & end time and that to be saved in desktop. Please help

  • @karnamannai5314
    @karnamannai5314 4 ปีที่แล้ว

    Super video this is very much useful,is it possible for us to save those files as PDF instead of excel format?.

    • @greggowaffles
      @greggowaffles  4 ปีที่แล้ว

      Thank you! Yes, you would just change the xlsx to pdf

  • @ivanpap634
    @ivanpap634 4 ปีที่แล้ว

    Great video! Really helpful, thank you for sharing

  • @binayyadav1987
    @binayyadav1987 4 ปีที่แล้ว

    Super