Retrieving Data from a Column / Row to populate a cell

  • Thread starter Thread starter mmc308
  • Start date Start date
M

mmc308

I currently have data supplied to me in an Excel spreadsheet that I to
transfer manually

I would like this to populate a cell reference, the problem I have is that I
cannot gather a train of thought to obtain the data from from a specific
row/column.

There is a sample of the data supplied to me below
Name In Out Int
Greg 165 108 29
09 July 2003 42 34 9
14 July 2003 44 19 4
16 July 2003 40 40 8
17 July 2003 39 15 8
Andrew 125 43 9
15 July 2003 41 13 2
16 July 2003 42 13 5
17 July 2003 42 17 2
Tony 114 99 48
01 July 2003 37 54 15
10 July 2003 33 16 20
17 July 2003 44 29 13

The data I would like to record would be as follows for a selected date
i.e. If I wanted to record data from column 4 on Date 16 July 2003

Greg 8
Andrew 5
Tony

I hope I have explained this clearly enough

Thanks in advance

Michael
 
The following macro inserts a new column, calculates the name for that
row, and turns on the AutoFilter. You could filter for a specific date,
and copy that data.

'==========================
Sub FixData()
Dim r As Long
r = Cells(Rows.Count, 1).End(xlUp).Row

Columns("A:A").EntireColumn.Insert Shift:=xlToRight
Range("A1").Value = "Name"
Range("B1").Value = "Date"
Range("A2").Formula = "=IF(A1=""Name"",B2,IF(ISNUMBER(B2),A1,B2))"
Range("A2").AutoFill Destination:=Range("A2:A" & r)
Range("A2").AutoFilter
End Sub
'==========================
 
Back
Top