Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find cell and paste data
I have the following code, broken :o(
What I am trying to do is if the date in A1 is in column F, select the cell one to the right to the one with the date. Into this cell paste the value from K1 Thanks Blue Sub finddate() Dim entereddate As Date entereddate = Range("A1").Value Dim founddate As String Dim sqm As Long sqm = Range("K1").Value Dim column As Range, finddate As Range Set column = Range("F:F") For Each finddate In column If finddate.Value = entereddate Then finddate.Select Next finddate Cells(ActiveCell.Row, ActiveCell.column + 1).Select founddate = ActiveCell.Address Cells(sqm).Select Selection.Copy Cells(founddate).Select End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find cell and paste data
Your code is a lot more complicated than it need be. Try to get rid of the
selections and have a look at OFFSET(0,1) for one cell to the right. -- Don Guillett SalesAid Software "Blue" wrote in message . uk... I have the following code, broken :o( What I am trying to do is if the date in A1 is in column F, select the cell one to the right to the one with the date. Into this cell paste the value from K1 Thanks Blue Sub finddate() Dim entereddate As Date entereddate = Range("A1").Value Dim founddate As String Dim sqm As Long sqm = Range("K1").Value Dim column As Range, finddate As Range Set column = Range("F:F") For Each finddate In column If finddate.Value = entereddate Then finddate.Select Next finddate Cells(ActiveCell.Row, ActiveCell.column + 1).Select founddate = ActiveCell.Address Cells(sqm).Select Selection.Copy Cells(founddate).Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find matching date in another worksheet, copy and paste data | Excel Discussion (Misc queries) | |||
Find, Match data and paste data between two workbooks | Excel Discussion (Misc queries) | |||
Macro to find text string in a column and paste data in another | Excel Discussion (Misc queries) | |||
I need a macro to find cut and paste data to new cell | Excel Discussion (Misc queries) | |||
I need a macro to find cut and paste data to new cell | Excel Discussion (Misc queries) |