Automatic Table Sort (vba code)

dellmech

New Member
Joined
Apr 22, 2018
Messages
14
Hi, I have something that seems it would be easy that I can't figure out and need some help.

I have a Table that looks like this:
A
1| COLORS
2| Blue
3| Orange
4| Red
Yellow

I want the user to be able to enter Green below Yellow and the table automatically sorts the data when the user hits enter. It is important that this be a Table so I'm looking for the VBA code to point out the table (not certain cells.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I think my “visual” was messed up. To summarize, I have a table that has data in it and when someone adds data to the table, I want the entire table to automatically put all the data in alphabetical order.

Example: if my table heading is “Colors” in cell (A1) and I have blue in (A2), orange in (A3)....when I type in “green” in (A4), I want the table to automatically be put in alphabetical order when I hit enter.

So (A2) would say blue, (A3) would say green and ((A4) would say orange
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top