Тёмный

Automatically Sorting Values after Entering a New Record using Excel VBA 

Dr. Todd Grande
Подписаться 1,5 млн
Просмотров 87 тыс.
50% 1

This video demonstrates how to automatically sort data using Excel VBA when a record is added to worksheet. This code in this example using the change event for the worksheet and updates two columns based on the values in one column.

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

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 50   
@aussiebreezekorb8877
@aussiebreezekorb8877 7 лет назад
This is a great example of what can be done to record and sort our data. Interesting for my responsibilities as a GA.
@dHunter94
@dHunter94 5 лет назад
Even though VBA is still confusing to me, this video was very concise. If I work with this program in the future, I will definitely be sure to utilize this playlist!
@lizconnor1820
@lizconnor1820 7 лет назад
I've just recently started using Excel more for work so I was really interested in learning how you automatically sort values after entering a new value in a field. It's highly useful and I'll definitely use it in the future!
@monicaperry13
@monicaperry13 7 лет назад
I do not know much, if anything, about writing code, but it seems useful when trying to sort the data, especially if there is a lot of it. This video explained things step by step, so it should be fairly easy to replicate.
@briannagoitiandia9833
@briannagoitiandia9833 7 лет назад
I have always appreciated learning how to write in code because I think once you get the hang of it, it makes things a lot easier when manipulating data. I appreciate how coding was shown how to be used in this video.
@corinne7324
@corinne7324 7 лет назад
I am intrigued by this and I love organization. I would have to watch this video again to fully understand but when I get the hang of it I think this can be fun.
@stephenbloom6722
@stephenbloom6722 5 лет назад
Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Column = 2 Then Dim lastRow As Long lastRow = Cells(Rows.Count, 2).End(xlUp).Row Range("A2:B" & lastRow).Sort key1:=Range("B2:B" & lastRow), order1:=xlAscending, Header:=xlNo End If End Sub You're welcome. ;)
@cristayag5915
@cristayag5915 5 лет назад
Thank you for sharing this. It's very helpful. If I am working on 4 columns, can it be possible to add a second level of sorting criteria after the first one using this code?
@MrsBobDylan
@MrsBobDylan 7 лет назад
I really like Excel and think that it is a good tool due to being able to sort your values and data automatically. Overall, this video was good and helped me understand how to use Excel more.
@luisrelorcasajr.9136
@luisrelorcasajr.9136 5 лет назад
Hi! What if I'm typing a text (letters) vertically in just 1 column, is it possible to sort automatically after typing?
@jessjane2479
@jessjane2479 7 лет назад
Where did the code come from? I replayed the beginning a few times but I'm still missing that part.
@umerkhan1709
@umerkhan1709 5 лет назад
Just copy his. It worked for me.
@natecoyle2835
@natecoyle2835 6 лет назад
How do you do this for more than 2 lines of data? I am trying to sort about 8 lines of data and I am unable to make it sort correctly
@tthompson719
@tthompson719 5 лет назад
Having no experience with VBA this wasn’t too helpful
@isagumus3174
@isagumus3174 5 лет назад
This video has a particular group of users as in it's aim which they know VBA and so, of course we are not expecting an ordinary bicycle mechanic to watch this video and make a work out of it.
@caionascimento4234
@caionascimento4234 4 года назад
Yeah, like how did he opened visual basic in the first place?
@inventor15
@inventor15 4 года назад
@@caionascimento4234 alt+f11
@DartsGondel
@DartsGondel 4 года назад
@@caionascimento4234 exactly what I wondered
@jjaeger14
@jjaeger14 4 года назад
this was excellent and saved me a lot of time.
@loriwardwell2957
@loriwardwell2957 7 лет назад
This would be a useful tool when there is a lot of data; I'm not very familiar with formatting code for excel but it seems pretty straight forward.
@tchizzz89
@tchizzz89 4 года назад
When entering you're data this way, that has hundreds of lines, is there anyway to automatically jump to that same cell that has most recently been entered and sorted? (Without using ctrl + F)
@Bakdawg
@Bakdawg 5 лет назад
This code works great! Thank you! However I can't get the worksheet to recognize the change when new data is added via Data Entry Form. Any Ideas on how to get it to recognize new data to the column this way?
@stephaniehernandez2024
@stephaniehernandez2024 3 года назад
I have 4 columns I am trying to auto sort as data is added: Patient Name Patient DOB Patient Phone Recall Due: I need the data from the 4 columns to sort by the Recall due date. I can not figure out the code to do this. It needs to go in ascending order by date.
@p.bhaiswar908
@p.bhaiswar908 6 лет назад
Sir, It's awesome. Is it possible for set print area that should fit to the data automatically without pressing any button as the manual data or for the data imported from another worksheet. Please provide me such a code.
@Reduce_Scan
@Reduce_Scan 7 лет назад
Please I need code to make this action As if I manually put the cursor inside cell a1 and then Inter, then I put the cursor inside cell a2 , then Inter, and so on
@johnboffin476
@johnboffin476 5 месяцев назад
Hello Mater Hiya, I want to sort one column with a switch so that after entering data it will set ascending order. Address is Column K7 and down to K2507, Row 1 to 6 have Titles and some displays. (VBA With a Switch to apply sort) so yer ...leave it with you to hear back
@sandro14308
@sandro14308 5 лет назад
Private Sub Worksheet_Change (ByVal Target As Excel.Range) If Target.Column = 2 Then Dim lastrow As Long lastrow = Cells(Rows.Count, 2).End(xlUp).Row Range("O25:P" & lastrow).Sort key1:=Range("P25:P" & lastrow), order1:=xlAscending, Header:=xlNo End If End Sub Не благодарите
@Sbaugh69
@Sbaugh69 5 лет назад
Thank you for this, it is so easy to recreate. The only question I have is how do you do it with a header row?
@joe1579
@joe1579 7 лет назад
This video was interesting. I know little about writing code.
@josephthole2547
@josephthole2547 4 года назад
This is very helpful, thank you!!!!!!!
@cjyokohama6204
@cjyokohama6204 5 лет назад
Thank you very much for this. Great help.
@belalmusallam
@belalmusallam Год назад
Can I use this code to sort the dates???
@ninastreet4630
@ninastreet4630 7 лет назад
This video is interesting. I would like to know more about the coding process after watching.
@karaannsullivan2363
@karaannsullivan2363 7 лет назад
Nina, the coding process does seem interesting. I have no idea about complicated computer programs, so this really opened my eyes on what could be created.
@averagejoe3474
@averagejoe3474 4 года назад
what if i only want to sort for example a2:b - a13:b13 not the whole column
@rajivkumart5161
@rajivkumart5161 5 лет назад
Hi Dr. Todd Grande, thank you for this script, can you please help me to sort dynamic data in excel. my data is updating from Web
@WenSaiPanther
@WenSaiPanther 6 лет назад
I use Numbers, a mac spreadsheet. Have any instructions for that?
@user-dm4yy4cg9r
@user-dm4yy4cg9r 7 лет назад
Thanks dear for that video please let me know how I can arrange data to specific irregular data by EXCEL VBA
@jaylid666
@jaylid666 5 лет назад
Can you please post the code aswell :)
@cyborg555
@cyborg555 5 лет назад
Can this be done with a Google docs spreadsheet?
@mediacmid
@mediacmid 6 лет назад
I need same story But For excel format as Table NOT for Normal Range
@sandeepkumar-cx4or
@sandeepkumar-cx4or 5 лет назад
thanks sir you are genious
@gointomars
@gointomars 5 лет назад
Great code and video! Solved my issue. Thank you for this!
@jay55patel
@jay55patel 7 лет назад
thank you if i want to choose sort column by drop down list
@pankajhiralalpatel4454
@pankajhiralalpatel4454 5 лет назад
Sir I am fresher in Excel VBA I have an Excel sheet in which many dates are written in column A and other data in column B to G. I want to create a combo box in userform which shows months (mmm_yy)of the month in which the dates are written in the column A.and I want to create a command button for autofilter data of the month which I select from combobox. suppose I have written many dates of April 18 , may 18 , June 18 , July 18 , December 18 and January 19 in column A so in combobox dropdown list shows April-18 may-18 June- 18 July 18 December 18 and January 19. Suppose I select June 18 from combobox dropdown list so autofilter sheet data of June 18 when I click on command button and copy filtered data to another sheet by another command button but duplicate entry avoid. Please help Thanks in advance
@teguhadinata8310
@teguhadinata8310 5 лет назад
anyone knows the way to get the same result without using VBA?
@aihemhasoon2023
@aihemhasoon2023 7 лет назад
I sent you message on your private messages please open it ..
@kimeeshareedwalker3263
@kimeeshareedwalker3263 7 лет назад
Excel seems a little more complicated than SPSS. I agree that it would be more useful with a lot of data
@GpD79
@GpD79 6 лет назад
This is very helpful! Could this be done with date values as well? If so, how would I do it?
Далее
Watermelon magic box! #shorts by Leisi Crazy
00:20
Просмотров 2,7 млн
How to get the Last Row in VBA(The Right Way!)
15:41
Просмотров 160 тыс.
Excel Sorting Showdown: VBA Sort - Episode 2093
7:40
Excel VBA: How to Sort Data with VBA Macro
8:37
Просмотров 102 тыс.
VBA to BROWSE & COPY Data from SELECTED File in Excel
10:00
VBA to Sort Data in Excel - Excel VBA Tutorial
7:57
Просмотров 55 тыс.
Watermelon magic box! #shorts by Leisi Crazy
00:20
Просмотров 2,7 млн