• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro - to copy and search the date from one Sheet to other.

aladin347

New Member
Hello team,

Could you please help me with a script for the below example.

1. Sheet 1 - has a Date ( from the data validation Field ( ex : 09/25/2014)
2. Sheet 2 - Has series of Date Horizontally in different cells but same row ( ex : 09/20/2014 | 09/21/2014 |09/25/2014)

The macro should look for the date in Sheet 1 and come to Sheet 2 and search the date and go below the date and extend formulas for the date.

I tried recording the macro, but it always stop at the same day which i recorded, even though i change the date from the data validation it still stops there.


Sub Macro1()
'
' Macro1 Macro
'


'
Selection.Copy
Sheets("sheet2").Select
Cells.Find(What:="9/22/2014", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range("W12").Select
End Sub

thanks,
Aladdin
 

Attachments

  • Help Workbook.xlsm
    25.5 KB · Views: 1
Hi Aladin

Give the following a try.

Code:
Sub FindAdd()
  Sheet2.Cells(14, Sheet2.Cells.Find([a8], , xlValues).Column) = "=SUM(R[-3]C:R[-1]C)"
End Sub

File attached to show workings.

Take care

Smallman
 

Attachments

  • FindDate.xlsm
    25.9 KB · Views: 4
Back
Top