Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Excell how to make a cell rotate names when taken off top
In a seniority worksheet columm how can I set it up so that I can make a
macro that will move a name from the top of a column to the bottom sort of like a rotate? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Excell how to make a cell rotate names when taken off top
Hi Vicky,
I'm not sure if this is what you are after. With the following macro, if you select the name of the person at the top of the list, then run the macro, that selected name is sent to the bottom and every other name moves up one row to fill the gap. Public Sub top_to_bottom() Dim rngRest As Range Dim vaTemp As Variant Dim iNumUsedRows As Long Dim iDemotedRow As Long iDemotedRow = ActiveCell.Row iNumUsedRows = Range("A:A").Rows.Count - _ Range(Cells(Range("A:A").Rows.Count, ActiveCell.Column), _ Cells(Range("A:A").Rows.Count, ActiveCell.Column). _ End(xlUp)).Rows.Count vaTemp = Cells(iDemotedRow, ActiveCell.Column).Value Set rngRest = Range(Cells(iDemotedRow + 1, ActiveCell.Column), _ Cells(iNumUsedRows + 1, ActiveCell.Column)) rngRest.Copy Cells(iDemotedRow, ActiveCell.Column) Cells(iNumUsedRows + 1, ActiveCell.Column).Value = vaTemp End Sub Ken Johnson |
#3
|
|||
|
|||
Quote:
Do you have one that rotates cells from bottom to top? so that last cell moves to the top and the rest move one down. Rgds Nathaniel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I make a formula in Excel to display result in same cell? | Excel Worksheet Functions | |||
Please make it easier to access the IS functions (e.g., isblank) . | Excel Worksheet Functions | |||
up to 7 functions? | Excel Worksheet Functions | |||
How can I Copy cell names from one workbook to another? | Excel Discussion (Misc queries) | |||
make a cell empty based on condition | Charts and Charting in Excel |