I want the moment that I insert a number >=12 on a cell for the complete row to move to the bottom of the list to the next available empty row.
How can this be done?
---cjs
I want the moment that I insert a number >=12 on a cell for the complete row to move to the bottom of the list to the next available empty row.
How can this be done?
---cjs
Maybe an event macro which goes in the workbook module (See link)
I've assumed you only want this to happen in 1 col. I've picked Col C. Just enter a value in say C3 and if you have rows complete below that it will move to the last row
http://www.contextures.com/xlvba01.html#Worksheet
or![]()
Private Sub Worksheet_Change(ByVal Target As Range) Dim last As Long last = Range("C65536").End(xlUp).Row If Target.Count > 1 Then Exit Sub If Not Intersect(Target, Range("C:C")) Is Nothing Then If Target.Value > = 12 Then Rows(Target.Row & ":" & Target.Row).Cut Rows(last + 1 & ":" & last + 1).Insert Shift:=xlDown End If End If End Sub
VBA Noob![]()
Private Sub Worksheet_Change(ByVal Target As Range) Dim last As Long last = Range("C65536").End(xlUp).Row If Target.Count > 1 Then Exit Sub If Not Intersect(Target, Range("C:C")) Is Nothing Then If Target.Value > 12 Then Rows(last + 1 & ":" & last + 1).Value = Rows(Target.Row & ":" & Target.Row).Value Rows(Target.Row & ":" & Target.Row).Clear End If End If End Sub
Last edited by VBA Noob; 06-12-2007 at 04:01 PM.
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
How do I do that...can you please email me a spreadsheet with it already in it??
See link
VBA Noob
Thank in advance it is working...kindof.
It will move the data...if any number in any column is over 12 also it dumps the row about 10 or 15 row below. How do I make it for 1 specific column or selective column? How do I have the macro constantly run? How do I force it to the line below the lowest?
Thank you again in advance.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks