Auto Cut & Paste a Cell into different Column

stully

New Member
Joined
Oct 30, 2017
Messages
14
I am looking for some help and I don't know if I can just use a formula or if I need a macro for this...

I have a 2-column worksheet
In Column A is a product Listing.
In Column B is a number listing based on the alpha sort from column A
People will be adding products into cell B2.

How do I get the sheet to add the product that is entered into cell B2 down into column A and have it be sorted in alphabetical order?

For example,
They enter in "bleach" in cell B2. When they hit "enter", "Bleach" would then be dropped into Column A and everything in column A would be sorted A to Z and cell B2 would be empty again.

Thank you for any help you can give!!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try a worksheet_change event macro:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim LR  As Long
    
    If Not Intersect(Target, Cells(2, 2)) Is Nothing Then
        With Application
            .ScreenUpdating = False
            .EnableEvents = False
        End With
        
        LR = Cells(Rows.count, 1).End(xlUp).row
        With Cells(1, 1)
            .Offset(LR).Value = .Offset(1, 1).Value
            .Offset(1, 1).ClearContents
            .Resize(LR + 1).Sort key1:=Cells(1, 1), order1:=xlAscending, header:=xlGuess
            .Offset(1, 1).Select
        End With
        
        With Application
            .ScreenUpdating = True
            .EnableEvents = True
        End With
    End If
    
End Sub
Make a copy of your workbook.
Right click on the sheet tab, select View Code and paste above in.
Test by entering values into B2
 
Last edited:
Upvote 0
YOU ARE AN ANGEL!!! This worked PERFECTLY! I have no idea how that works, but it does! I cannot thank you enough!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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