Тёмный

Save File As (Based on Cell Value) | Excel VBA Macro 

greggowaffles
Подписаться 6 тыс.
Просмотров 37 тыс.
50% 1

Excel VBA Macro: Save File As (Based on Cell Value). In this video, we create a macro that filters data and saves file based on cell value. If you ever need to automatically filter data and save a file based on another cell in your workbook, with Excel VBA, you can use the code we write in this video to automatically filter data across pertaining to a value in a cell that can changed, without having to alter the code. The code specifies which worksheet it will be filtering, the starting point for the filtering, and then what cell will be used to filter by. The cell does not have to be on the same worksheet, and we can change the value of the cell as we please and filter by whatever we decide. After the filter is applied, only values that we want to see will be visible: giving you the freedom to change the value you filer by at will; same goes for saving the file. You can save the same file multiple times with different file names by changing the name of the cell value you are referencing. This video shows you the file path as the macro runs so that you can see the file get saved down with the cell value in the file name as well.
Data used in this video:
gsociology.ica...
#ExcelVBA #ExcelMacro

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@greggowaffles
@greggowaffles 3 года назад
Save Worksheet As PDF (Based on Cell Value): ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ssv5Y32gBAU.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!!
@mujtaba135
@mujtaba135 3 года назад
Exactly what I am looking for
@greggowaffles
@greggowaffles 3 года назад
😎
@alexandergdansk
@alexandergdansk 3 года назад
Great tutorial! Thanx a lot!!! :)
@greggowaffles
@greggowaffles 3 года назад
Glad to hear that! Thanks for watching!!
@ivanpap634
@ivanpap634 4 года назад
Great video! Really helpful, thank you for sharing
@greggowaffles
@greggowaffles 4 года назад
No problem! :-)
@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
@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.)
@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
@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?
@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 года назад
No problem! You can combine code from this video and this one to get what you want: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-cFkP4Can4BY.html hope that helps!
@chsproteus5770
@chsproteus5770 3 года назад
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 3 года назад
Thats a great idea! I'll start working on that ASAP! Thanks!!
@greggowaffles
@greggowaffles 3 года назад
here you go! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ssv5Y32gBAU.html
@binayyadav1987
@binayyadav1987 4 года назад
Super
@greggowaffles
@greggowaffles 4 года назад
Thanks!
Далее
Save File As (SaveAs) with Password | Excel VBA Macro
3:33
Excel VBA Save File as Cell Value
14:12
Просмотров 24 тыс.
Master These Simple Filtering Hacks In Excel VBA Today
23:26
Save Excel file using data from cells & single click
7:42