Hi
I Need Vba Code Automatically Sort Large To Small
Hi
I Need Vba Code Automatically Sort Large To Small
Range("A:A").Sort(xlDescending)
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Thank you SamT
You can give me full code
With the information you posted, that is all I can give.
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Here is an example using event code to automatically sort entries in column A.
Have a Great Day!
Thank you
You can edit Automtically run macro when opening file excel
Private Sub Worksheet_Change(ByVal Target As Range) Dim N As Long If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub N = Cells(Rows.Count, "A").End(xlUp).Row Range("A1:A" & N).Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlYes End Sub
when changing cell A in sheet2 automatically sort cell A in sheet1
Last edited by etheer; 06-23-2013 at 02:12 PM.
if you want the macro run when the workbook is opened put it in ThisWorkbook code module with Workbook_Open event.Originally Posted by etheer
[VBA]Private Sub Workbook_Open()
Dim N As Long
With Worksheets("Sheet1")
N = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("A1:A" & N).Sort Key1:=.Range("A1"), Order1:=xlDescending, Header:=xlYes
End With
End Sub
[/VBA]
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)
goes to the code module of Sheet2Originally Posted by etheer
[VBA]Private Sub Worksheet_Change(ByVal Target As Range)
Dim N As Long
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
With Worksheets("Sheet1")
N = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("A1:A" & N).Sort Key1:=.Range("A1"), Order1:=xlDescending, Header:=xlYes
End With
End Sub
[/VBA]
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)
I used data online in sheet my problem in code i need click on enter in keyword for work code
when change cell online dont work code
im not sure i can follow you.
if you run ev_off macro in GarysStudent's file, it will suppress the events. and nothing will happen associated with that event code.
you have to enable events by running ev_on macro.
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)
don't work code automatically working when click enter in keyboard
Can you be a little more precise in the information that you currently offer?Originally Posted by etheer
Are you entering a value when you click on enter or simply selecting the cell?
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
i need when changing cell A in sheet2 automatically sort large to small
in sheet1
please download file
A Sorted Affair2.xlsm
That is significantly different from the initial post, which stated "I Need Vba Code Automatically Sort Large To Small" then moved to "when changing cell A in sheet2 automatically sort cell A in sheet1", which is different to "i need when changing cell A in sheet2 automatically sort large to small in sheet1".
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link