I NEED AN LIST A LIST TO ALPABETIZE FROM COLUMNS A-AP

Status
Not open for further replies.

Daleksec93

New Member
Joined
Aug 18, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I currently have a sheet that is alphabetizing itself when a name is entered into the B column. header are on row 2 of sheet. the information in each row needs to stay with each name. right now the last two columns are not stay with their corresponding rows meaning they are being added to a row they do not belong to. My spreadsheet goes from A to AP. columns AL and AM or not stay with their rows. my codes are below:
mod 2
Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.CountLarge = 1 And Not Intersect(Range("A4", Cells(Rows.Count, "A").End(xlUp)), Target) Is Nothing Then
If Target.Value <> "Z" Then Exit Sub
Dim lRow As Long
lRow = Sheets("REMOVED").Cells.Find("*", , xlFormulas, , 1, 2).Row + 1
With Target.EntireRow
.Copy Sheets("REMOVED").Cells(lRow, 1)
.Delete xlUp
End With
End If
sheet (current)
Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = Worksheets("CURRENT")
Set ws2 = Worksheets("REMOVED")
Dim LRowCUR As Long, LRowREM As Long
LRowCUR = ws1.Cells.Find("*", , xlFormulas, , 1, 2).Row
LRowREM = ws2.Cells.Find("*", , xlFormulas, , 1, 2).Row + 1

If Target.Cells.CountLarge = 1 And Not Intersect(Range("A3:B" & LRowCUR), Target) Is Nothing Then
Select Case Target.Column
Case Is = 1
If Target.Value = "Z" Then
Application.EnableEvents = False
With Target.EntireRow
.Copy ws2.Cells(LRowREM, 1)
.Delete xlUp
End With
ws2.Range("B3").CurrentRegion.Sort Key1:=ws2.Range("B3"), order1:=xlAscending, Header:=xlYes
End If
Case Is = 2
Application.EnableEvents = False
ws1.Range("B2").CurrentRegion.Sort Key1:=ws1.Range("B2"), order1:=xlAscending, Header:=xlYes
End Select
End If
Application.EnableEvents = True
End Sub
i do not which one the issue is on please help!!
some on the list is transferred to next sheet through letter Z in column A
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,918
Messages
6,122,246
Members
449,075
Latest member
staticfluids

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