ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Vlookup (https://www.excelbanter.com/excel-worksheet-functions/209720-vlookup.html)

NM

Vlookup
 

Hi,
I have projects in Rows and I have column with dates of projects.When I
enter a date in column B for any row, I want the data in the row to be pulled
in a different sheet.
For instance: There are 120 rows,Column B has dates for them.Some may have
date some may not. when I enter a date in column B I want the data of just
that row From B2 to BQ2 to be pulled in a different sheet.

Is there a way to do this. Please help me.
Thanks much!


Sheeloo[_3_]

Vlookup
 
Try the following macro (and tweak it according to your need)
(Right-click on the source sheet, select view code and paste the macro)
It will copy the currnet row if anything is entered in Col B
You may like to add a check for date..

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Answer As String
Dim LastRowOnSheet2 As Long
If Target.Column = 2 Then
With Worksheets("Sheet2")
LastRowOnSheet2 = .Cells(.Rows.Count, "B").End(xlUp).Row
If LastRowOnSheet2 = 1 And .Cells(1, "B").Value = "" Then
LastRowOnSheet2 = 0
End If
Selection.Offset(-1, 0).EntireRow. _
Copy .Range("A" & (LastRowOnSheet2 + 1))
End With
End If
End Sub


"NM" wrote:


Hi,
I have projects in Rows and I have column with dates of projects.When I
enter a date in column B for any row, I want the data in the row to be pulled
in a different sheet.
For instance: There are 120 rows,Column B has dates for them.Some may have
date some may not. when I enter a date in column B I want the data of just
that row From B2 to BQ2 to be pulled in a different sheet.

Is there a way to do this. Please help me.
Thanks much!



All times are GMT +1. The time now is 09:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com