to see data on top

shafiq247

Board Regular
Joined
Feb 8, 2016
Messages
52
Hi good evening
I am working on a file which have lot of data, I daily update that file, now my question if I enter a date in date cell that row go automatically on top of the blank cell
Thanks
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,075
Office Version
365
Platform
Windows
I don't think your question is all that clear.
It may make more sense to us if you can walk us through an actual example with data.
 

shafiq247

Board Regular
Joined
Feb 8, 2016
Messages
52
Customer
Finish
Order Qty
Received by
Date
Levi's
Button On
3082
XYZ
Levi's
Bad
3120
abc
J Crew
Frost
6287
xyz
7-10-2019

<tbody>
</tbody>
no my question is if I put date in date cell, that row go automatically on top of all rows
 

shafiq247

Board Regular
Joined
Feb 8, 2016
Messages
52
I need a code, if a enter date in date cell the entire row move up on empty (date) rows
 

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,687
Office Version
365, 2019, 2016
Platform
Windows
This seems to do what you are looking for. This code assumes that you don't have anything in column F.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("E2:E" & Rows.Count), Target) Is Nothing Then
    If IsDate(Target.Value) Then
        Target.Offset(, 1).Value = 1
        Range("A1").CurrentRegion.Sort Key1:=Range("F1"), Order1:=xlAscending, Header:=xlYes
        Range("F:F").ClearContents
    End If
End If
End Sub
 

shafiq247

Board Regular
Joined
Feb 8, 2016
Messages
52
I put this code in sheet but it's not working,( column f is date column )
 
Last edited:

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,723
Office Version
2013
Platform
Windows
From looking at your post I would have thought column E was the column you wanted to enter date in.
So is column G being used?

I put this code in sheet but it's not working,( column f is date column )
 

shafiq247

Board Regular
Joined
Feb 8, 2016
Messages
52
thanks for assistance,
code is working but there is 1 problem
I want to skip top two rows first one is title of sheet and 2nd is heading of column
 

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
2,687
Office Version
365, 2019, 2016
Platform
Windows
Try this

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("F3:F" & Rows.Count), Target) Is Nothing Then
    If IsDate(Target.Value) Then
        Target.Offset(, 1).Value = 1
        Range("B2:G" & Range("B" & Rows.Count).End(xlUp).Row).Sort Key1:=Range("G2"), Order1:=xlAscending, Header:=xlYes
        Range("G:G").ClearContents
    End If
End If
End Sub
 
Last edited:

Forum statistics

Threads
1,089,452
Messages
5,408,312
Members
403,196
Latest member
annph

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top